dylan changed the topic of #ocaml to: OCaml 3.09.1 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
m3ga has joined #ocaml
sieni has quit [Read error: 110 (Connection timed out)]
smimou has quit ["bli"]
Amorphous has quit [Connection timed out]
jer has joined #ocaml
humasect has quit ["Leaving.."]
Amorphous has joined #ocaml
Revision17 has quit [Remote closed the connection]
Amorphous has quit [Connection timed out]
Poopsmith is now known as KinkyFriedman
Smerdyakov has quit [Read error: 110 (Connection timed out)]
Smerdyakov has joined #ocaml
Smerdy has joined #ocaml
Smerdyakov has quit [Read error: 110 (Connection timed out)]
pango_ has joined #ocaml
khaladan has quit [Read error: 104 (Connection reset by peer)]
Smerdy is now known as Smerdyakov
pango has quit [Read error: 110 (Connection timed out)]
KinkyFriedman is now known as Poopsmith
Amorphous has joined #ocaml
gim has quit ["zoup"]
Schmurtz has quit ["Dodo !"]
m3ga has quit ["disappearing into the sunset"]
rillig_ has joined #ocaml
naerbnic has quit []
rillig has quit [Read error: 110 (Connection timed out)]
Smerdyakov has quit ["Leaving"]
slipstream-- has joined #ocaml
slipstream has quit [Connection timed out]
perspectivet has joined #ocaml
<perspectivet> hi, I'm new to the channel and new to ocaml, though once a regular use of sml
<perspectivet> What is the idiomatic way to read a structured multi-type binary file?
<perspectivet> I've found the extLib IO class to be pretty helpful so far, but reading the binary stream into a hand constructed class seems pretty weak.
<perspectivet> record initialization oddness doesn't seem to lend itself to an elegant solution either.
ski has quit [Read error: 110 (Connection timed out)]
ski has joined #ocaml
<flux__> hmm.. I'm thinking one elegant way would be, for type foo = { a: string; b: int}; to provide something like let foo_structure = [`A, `String (255, encode_string); `B, `Int (4, encode_int)] and then the loading function would look something like let write_foo foo = let buf = Buffer.create () in let s = encode buf foo
<flux__> oh, that was writing, I wonder if it's more difficult for reading ;)
<flux__> encode should also refer to foo_structure
<flux__> sigh, I fixed my code into something that cannot work
<flux__> let write_foo foo = let buf = Buffer.create () in let s = encode buf foo_structure; s `A foo.a; s `B foo.b was what I was thinking
<flux__> the reading part is going to be more complex, though
<perspectivet> I've been reading through the camlp4 tutorial. a syntax extension seem to be the way to go. though it's still not simple.
<flux__> let read_foo () = let s = decode buffer_in foo_structure in let a = destring (s `A) in let b = destring (s `B) in { a: a; b: b}
<flux__> yes, syntax extension would give you much cleaner code, and may be wortwhile if you're doing lots of that
<flux__> (actually s/destring/identity/; s/destring/int_of_string/)
<perspectivet> Yah, I'll probably be doing a lot of it.
<perspectivet> flux__: thanx for the help, btw. Make me think a little deeper on the problem than I have.
<perspectivet> Still thinking C++-ish about the problem. Not good.
jo_l_apache has joined #ocaml
<flux__> good luck with your project
<perspectivet> thanks.
jo_l_apache has quit ["leaving"]
rillig_ is now known as rillig
sieni has joined #ocaml
m3ga has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
jo_l_apache has joined #ocaml
Bigb[a]ng is now known as Bigbang
sieni has quit [Read error: 110 (Connection timed out)]
gim has joined #ocaml
jo_l_apache has quit [Read error: 110 (Connection timed out)]
Anarchos has joined #ocaml
pcc has joined #ocaml
pcc has left #ocaml []
smimou has joined #ocaml
Schmurtz has joined #ocaml
Demitar has quit [Remote closed the connection]
demitar has joined #ocaml
sieni has joined #ocaml
demitar_ has joined #ocaml
demitar has quit [Read error: 110 (Connection timed out)]
demitar__ has joined #ocaml
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
descender has joined #ocaml
mikeX has joined #ocaml
demitar_ has quit [Read error: 110 (Connection timed out)]
_JusSx_ has joined #ocaml
demitar__ is now known as Demitar
Anarchos has joined #ocaml
ski_ has joined #ocaml
ski has quit [Read error: 110 (Connection timed out)]
Demitar has quit [Remote closed the connection]
Demitar has joined #ocaml
Smerdyakov has joined #ocaml
jo_l_apache has joined #ocaml
jo_l_apache has quit ["leaving"]
quamaretto has joined #ocaml
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
ski_ has quit [Read error: 104 (Connection reset by peer)]
ski has joined #ocaml
ski has quit [Connection timed out]
vodka-goo has joined #ocaml
Demitar has quit [Remote closed the connection]
quamaretto has quit ["Leaving"]
Demitar has joined #ocaml
Demitar has quit [Remote closed the connection]
Demitar has joined #ocaml
Schmurtz has quit ["Plouf !"]
Bigbang is now known as Bigb[a]ng
Schmurtz has joined #ocaml
gim has quit [Read error: 104 (Connection reset by peer)]
gim has joined #ocaml
vodka-goo has quit ["bn"]
kral has joined #ocaml
kral has quit [""In girum imus nocte et consumimur igni.""]
sieni has quit [Read error: 110 (Connection timed out)]
_JusSx_ has quit ["leaving"]