cymonts__ is now known as cymonts
skylan has quit [Read error: 104 (Connection reset by peer)]
skylan has joined #ocaml
cymonts has quit [Read error: 110 (Connection timed out)]
gl has quit [Read error: 113 (No route to host)]
gl has joined #ocaml
gl-limsi has joined #ocaml
smkl has quit [Read error: 110 (Connection timed out)]
smkl has joined #ocaml
RavenClaw has joined #ocaml
<RavenClaw> can someone provide me a code snipet for searching a string in a file and return the matching line ?
<RavenClaw> how can i read a line from a channel ?
malc has joined #ocaml
<RavenClaw> anyone listening ?
<malc> yes
<RavenClaw> oh, hi
<malc> lo
<RavenClaw> can you help me, with a little test program ....just opening a file and read a line ...
<RavenClaw> let inch = try open_in "fake.dat";
<RavenClaw> print_endline input_line inch
<RavenClaw> i tried this ...
<RavenClaw> but it seems he wants something afterwards ...
<malc> let inch = open_in "fake.dat" in print_enldine (input_line inch)
<RavenClaw> it seems i dont understand when to make a ;
<malc> ; is for sequences
<malc> uh.. it delimits statements
<RavenClaw> ok, like in c ...
<malc> like.. print_endline "moo"; print_endline "foo"
<malc> we have print_endline which is executed purely for side effect
<RavenClaw> for side effect ?
<malc> print_endline has following signature string -> unit
<malc> so it takes string and returns nothing
<malc> so its result is really a side effect
<malc> value printed on standard output
<RavenClaw> so unit is nothing ... ?
<malc> unit is unit
<RavenClaw> ok, seems i have to read something from the beginning ...i just wanted to add a few lines to mldonkey (check a md4 hash string against lines in a file) but this seems harder than i thought ...
<malc> quite easy id guess, but might require some reading if you dont know ocaml at all
<RavenClaw> i know c/java ...but ocaml is a bit different ...reading is easy :) but writing ...
<malc> writing is even easier :)
<malc> <after a while>
<RavenClaw> *g*
<RavenClaw> ocaml seems to me like a nice language ... maybe i've a bit time left to read more into it
<RavenClaw> is there a index of the libraries/funktions somewhere ?
<malc> stdlib is referenced in ocaml manual
<malc> Part IV
<RavenClaw> thanx
<RavenClaw> do you know a way to make a string in string search ? i only found
<RavenClaw> val string_match : regexp -> string -> int -> bool
<RavenClaw> from the Str Module ...
<malc> Str.regex
<malc> Str.regexp even
owll has joined #ocaml
<RavenClaw> ok, so i have to add the Str module ...with ..
<RavenClaw> open Str ?
<malc> just use Str.regexp when you need it
<malc> do not polute global namespace
<RavenClaw> oh ...ok...
owll has quit [Excess Flood]
owll has joined #ocaml
owll has quit ["Client Exiting"]
<RavenClaw> finding errors is hard when you dont know the language :)
<malc> indeed
<RavenClaw> you sound like Tia'k from stargate ... *g* (indeed)
<malc> uh-oh
<RavenClaw> can you tell me whats wrong in this line
<RavenClaw> let line = (input_line inch)
<malc> if it's followed by [in|and] ... then nothing
<RavenClaw> seems like thats the problem
<RavenClaw> is it possible to use it this way ...
<RavenClaw> Str.string_match (Str.regexp "c71d1f071f9d4ed0d2ed60310bbd650b") line 0
<malc> yep
<RavenClaw> then why am i getting ...
<RavenClaw> Reference to undefined global `Str'
<malc> you havent linked str in
<RavenClaw> ok, so no error in the code ...*phuuu*
<RavenClaw> cool, works ....except for eof :)...thanx for all the answers
<malc> n/p
malc has quit ["no reason"]
malc has joined #ocaml
gl-limsi has quit ["Client Exiting"]
TimFreeman has joined #ocaml
<Dybbuk> Hi everybody!
<RavenClaw> hi
<Dybbuk> I've been doing some fun stuff with OcamlPVM.
<RavenClaw> whats that ? (i'm new to ocaml ...started today :)
<Dybbuk> I'm pretty new as well...just started learning it about a week ago.
<Dybbuk> PVM is 'parallel virtual machine'...it's like a virtual cluster.
<Dybbuk> OcamlPVM is the interface to PVM.
TimFreeman has left #ocaml []
malc has quit ["no reason"]
RavenClaw has left #ocaml []
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
exa has joined #ocaml
<exa> hey
<exa> any good parser combinator libs for ocaml?
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
<smkl> exa: probably not
<Dybbuk> Ok...so I do a 'String.create 50'. How do I tell OCaml that everything past the 3rd character should be ignored for now?
<Dybbuk> In other words, I need all that lenght because the string is going to grow...
<Dybbuk> s/ht/th/
<smkl> try using Buffer instead
<Dybbuk> Ok, will do.
TimFreeman has joined #ocaml
<Dybbuk> Damn, buffer won't work...I need to modify the contents of the string.
<smkl> you need to make your own datastructure then...
<Dybbuk> Yeah, fooey.
malc has joined #ocaml
malc has quit ["no reason"]