00:19
cymonts__ is now known as cymonts
02:16
skylan has quit [Read error: 104 (Connection reset by peer)]
02:23
skylan has joined #ocaml
03:56
cymonts has quit [Read error: 110 (Connection timed out)]
07:01
gl has quit [Read error: 113 (No route to host)]
07:02
gl has joined #ocaml
07:37
gl-limsi has joined #ocaml
09:53
smkl has quit [Read error: 110 (Connection timed out)]
10:50
smkl has joined #ocaml
11:06
RavenClaw has joined #ocaml
11:17
<
RavenClaw >
can someone provide me a code snipet for searching a string in a file and return the matching line ?
11:36
<
RavenClaw >
how can i read a line from a channel ?
13:01
malc has joined #ocaml
13:11
<
RavenClaw >
anyone listening ?
13:12
<
RavenClaw >
can you help me, with a little test program ....just opening a file and read a line ...
13:12
<
RavenClaw >
let inch = try open_in "fake.dat";
13:12
<
RavenClaw >
print_endline input_line inch
13:13
<
RavenClaw >
i tried this ...
13:13
<
RavenClaw >
but it seems he wants something afterwards ...
13:13
<
malc >
let inch = open_in "fake.dat" in print_enldine (input_line inch)
13:14
<
RavenClaw >
it seems i dont understand when to make a ;
13:14
<
malc >
; is for sequences
13:14
<
malc >
uh.. it delimits statements
13:15
<
RavenClaw >
ok, like in c ...
13:16
<
malc >
like.. print_endline "moo"; print_endline "foo"
13:16
<
malc >
we have print_endline which is executed purely for side effect
13:16
<
RavenClaw >
for side effect ?
13:17
<
malc >
print_endline has following signature string -> unit
13:17
<
malc >
so it takes string and returns nothing
13:18
<
malc >
so its result is really a side effect
13:18
<
malc >
value printed on standard output
13:18
<
RavenClaw >
so unit is nothing ... ?
13:18
<
malc >
unit is unit
13:19
<
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 ...
13:20
<
malc >
quite easy id guess, but might require some reading if you dont know ocaml at all
13:21
<
RavenClaw >
i know c/java ...but ocaml is a bit different ...reading is easy :) but writing ...
13:21
<
malc >
writing is even easier :)
13:21
<
malc >
<after a while>
13:22
<
RavenClaw >
ocaml seems to me like a nice language ... maybe i've a bit time left to read more into it
13:23
<
RavenClaw >
is there a index of the libraries/funktions somewhere ?
13:24
<
malc >
stdlib is referenced in ocaml manual
13:46
<
RavenClaw >
do you know a way to make a string in string search ? i only found
13:46
<
RavenClaw >
val string_match : regexp -> string -> int -> bool
13:46
<
RavenClaw >
from the Str Module ...
13:47
<
malc >
Str.regexp even
13:48
owll has joined #ocaml
13:48
<
RavenClaw >
ok, so i have to add the Str module ...with ..
13:48
<
RavenClaw >
open Str ?
13:48
<
malc >
just use Str.regexp when you need it
13:48
<
malc >
do not polute global namespace
13:49
<
RavenClaw >
oh ...ok...
14:06
owll has quit [Excess Flood]
14:08
owll has joined #ocaml
14:17
owll has quit ["Client Exiting"]
14:30
<
RavenClaw >
finding errors is hard when you dont know the language :)
14:33
<
RavenClaw >
you sound like Tia'k from stargate ...
*g* (indeed)
14:36
<
RavenClaw >
can you tell me whats wrong in this line
14:36
<
RavenClaw >
let line = (input_line inch)
14:36
<
malc >
if it's followed by [in|and] ... then nothing
14:37
<
RavenClaw >
seems like thats the problem
14:56
<
RavenClaw >
is it possible to use it this way ...
14:56
<
RavenClaw >
Str.string_match (Str.regexp "c71d1f071f9d4ed0d2ed60310bbd650b") line 0
14:57
<
RavenClaw >
then why am i getting ...
14:57
<
RavenClaw >
Reference to undefined global `Str'
14:57
<
malc >
you havent linked str in
14:58
<
RavenClaw >
ok, so no error in the code ...*phuuu*
15:03
<
RavenClaw >
cool, works ....except for eof :)...thanx for all the answers
15:06
malc has quit ["no reason"]
15:39
malc has joined #ocaml
15:55
gl-limsi has quit ["Client Exiting"]
16:31
TimFreeman has joined #ocaml
16:48
<
Dybbuk >
Hi everybody!
16:48
<
Dybbuk >
I've been doing some fun stuff with OcamlPVM.
16:49
<
RavenClaw >
whats that ? (i'm new to ocaml ...started today :)
16:50
<
Dybbuk >
I'm pretty new as well...just started learning it about a week ago.
16:50
<
Dybbuk >
PVM is 'parallel virtual machine'...it's like a virtual cluster.
16:50
<
Dybbuk >
OcamlPVM is the interface to PVM.
16:51
TimFreeman has left #ocaml []
17:03
malc has quit ["no reason"]
17:07
RavenClaw has left #ocaml []
18:55
gl has quit [Read error: 104 (Connection reset by peer)]
18:55
gl has joined #ocaml
19:55
exa has joined #ocaml
19:55
<
exa >
any good parser combinator libs for ocaml?
20:10
gl has quit [Read error: 104 (Connection reset by peer)]
20:10
gl has joined #ocaml
20:15
<
smkl >
exa: probably not
21:30
<
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?
21:30
<
Dybbuk >
In other words, I need all that lenght because the string is going to grow...
21:33
<
smkl >
try using Buffer instead
21:35
<
Dybbuk >
Ok, will do.
21:38
TimFreeman has joined #ocaml
21:43
<
Dybbuk >
Damn, buffer won't work...I need to modify the contents of the string.
21:48
<
smkl >
you need to make your own datastructure then...
21:50
<
Dybbuk >
Yeah, fooey.
22:02
malc has joined #ocaml
23:18
malc has quit ["no reason"]