gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
Drakken has left #ocaml []
oriba has quit [Quit: oriba]
Tobu has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
iago has quit [Quit: Leaving]
testcocoon has quit [Remote host closed the connection]
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
MaskRay has quit [Ping timeout: 245 seconds]
mjonsson has quit [Quit: Leaving]
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
testcocoon has joined #ocaml
MaskRay has quit [Ping timeout: 255 seconds]
EmmanuelOga has joined #ocaml
everyonemines has joined #ocaml
MaskRay has joined #ocaml
in10t has joined #ocaml
<in10t> Hey all. I need to do a little file I/O with extlib, and I'm not clear on what the correct way is to do sequential binding of names to the values read within a begin...end block. If I do "begin let a = IO.read_double infile; let b = IO.read_double; (a, b) end I get a syntax error. What would be the correct way to do this?
<everyonemines> are you passing the input to the second read function
<in10t> that should read "let b = IO.read_double infile; (a, b)"
<everyonemines> second, you're separating with ;
<everyonemines> it's let....in
MaskRay_ has joined #ocaml
<everyonemines> btw, begin...end is equivalent to (...)
<everyonemines> so most people dont use it
<in10t> I thought that was the correct way to enforce in-order operations in an imperative block?
MaskRay has quit [Read error: Connection reset by peer]
<everyonemines> no, let statements are ordered
<in10t> The semicolon
<everyonemines> no
<everyonemines> it separates imperative statements
<everyonemines> "let" is not imperative
lamawithonel__ has joined #ocaml
<in10t> OK, I see, thank you.
<everyonemines> you want let a = ... in let b = ... in a,b
lamawithonel_ has quit [Ping timeout: 240 seconds]
<everyonemines> finally, I think idiomatic ocaml would be: let read() = IO.read_double infile in read(),read()
<everyonemines> hmm, actually I'm not sure if that would force ordering
<everyonemines> meh
iris1 has quit [Quit: iris1]
lamawithonel__ has quit [Ping timeout: 244 seconds]
<everyonemines> nope, that isn't ordered. So yeah, you need to use 2 let statements to force the ordering.
<in10t> yeah, that worked beautifully. thanks everyonemines .
lamawithonel__ has joined #ocaml
lamawithonel__ has quit [Ping timeout: 240 seconds]
EmmanuelOga has quit [Ping timeout: 244 seconds]
ankit9 has joined #ocaml
othiym23 has joined #ocaml
ulfdoz has quit [Ping timeout: 256 seconds]
asdfhjkl has quit [Quit: Leaving]
everyonemines has quit [Quit: Leaving.]
xuser has joined #ocaml
Tobu has quit [Ping timeout: 252 seconds]
xuser has quit [Quit: leaving]
ankit9 has quit [Ping timeout: 240 seconds]
othiym23 has quit [Quit: Linkinus - http://linkinus.com]
Tobu has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
<flux> indeed, multiple side effects in a single expression not using ; are typically a good idea..
<flux> (for example tuples are constructed right-to-left)
Tobu has quit [Ping timeout: 252 seconds]
testcocoon has joined #ocaml
ankit9 has joined #ocaml
<MaskRay_> so it'll print "cba" when executing `let s=print_string in (s "a", s "b", s "c");;' ?
<flux> yes, but by no means should one write code that relies on that behavior :)
Cyanure has joined #ocaml
edwin has joined #ocaml
silver has joined #ocaml
Tobu has joined #ocaml
Tobu has quit [Changing host]
Tobu has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
Cyanure has quit [Remote host closed the connection]
Snark has joined #ocaml
thomasga has joined #ocaml
Cyanure has joined #ocaml
ocp has joined #ocaml
kmc has quit [Quit: Leaving]
cago has joined #ocaml
kmc has joined #ocaml
thizanne has quit [Ping timeout: 255 seconds]
thizanne has joined #ocaml
ocp has quit [Quit: Leaving.]
Tobu has quit [Ping timeout: 252 seconds]
Submarine has joined #ocaml
foocraft has quit [Read error: Operation timed out]
Tobu has joined #ocaml
foocraft has joined #ocaml
_andre has joined #ocaml
asdfhjkl has joined #ocaml
emias has quit [Quit: Changing server]
emias has joined #ocaml
ikaros has joined #ocaml
Tobu has quit [Ping timeout: 247 seconds]
ikaros has quit [Quit: Ex-Chat]
sgnb`` is now known as sgnb
Tobu has joined #ocaml
rby has quit [Ping timeout: 252 seconds]
iago has joined #ocaml
emmanuelux has joined #ocaml
iago has quit [Ping timeout: 260 seconds]
thizanne has quit [*.net *.split]
wagle has quit [*.net *.split]
dsheets has quit [*.net *.split]
wagle has joined #ocaml
thizanne has joined #ocaml
dsheets has joined #ocaml
letrec has joined #ocaml
iago has joined #ocaml
Tobu has quit [Ping timeout: 252 seconds]
iago has quit [Ping timeout: 252 seconds]
Tobu has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
EmmanuelOga has joined #ocaml
ftrvxmtrx has joined #ocaml
iago has joined #ocaml
hyperbor1ean is now known as hyperboreean
Tobu has quit [Ping timeout: 272 seconds]
rby has joined #ocaml
antegallya has joined #ocaml
Tobu has joined #ocaml
EmmanuelOga has quit [Ping timeout: 244 seconds]
BiDOrD_ has joined #ocaml
Submarine has quit [Ping timeout: 244 seconds]
<bnwr> Hashtbl can be used as an imperative Map. Is there a module that can be used as an imperative Set?
<thelema> bnwr: Hashtbl
BiDOrD has quit [Ping timeout: 248 seconds]
<thelema> ('a, unit) Hashtbl.t
<bnwr> thelema: storing () as a second component?
<bnwr> ok
<bnwr> thanks
<thelema> what is your 'a?
<thelema> if your 'a is int, BatBitSet may be good for you
<bnwr> ip addresses (with a weird internal representation)
<thelema> ranges?
<bnwr> int32
<bnwr> and I only need to store a handfull of them
<thelema> you can use a list
<thelema> if handful is .. < 10
EmmanuelOga has joined #ocaml
iago has quit [Read error: Operation timed out]
iago has joined #ocaml
<bnwr> I'll try a list ref (I actually need it to be imperative for equality purpose)
<thelema> equality purpose? curious
<bnwr> yeah, I need [let old = x in add x y; let new_ = x in old = new_] to be [true] for all [x] and [y]
fraggle_ has quit [Read error: Connection reset by peer]
<bnwr> I'll try other approaches afterward, but for now I'm trying with this
<flux> bnwr, hmm, it isn't too difficult to use any immutable datastructure in an imperative fashion, just use references?
fraggle_ has joined #ocaml
beckerb has joined #ocaml
iago has quit [Ping timeout: 245 seconds]
iago has joined #ocaml
ocp has joined #ocaml
yroeht has quit [Ping timeout: 240 seconds]
ocp has quit [Read error: Connection reset by peer]
Tobu has quit [Ping timeout: 252 seconds]
benytc has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
ankit9 has quit [Remote host closed the connection]
Tobu has joined #ocaml
MaskRay_ has quit [Quit: leaving]
Drup has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
r126f has joined #ocaml
r126f has quit [Client Quit]
Submarine has quit [Quit: Leaving]
iago has quit [Read error: Operation timed out]
ulfdoz has joined #ocaml
iago has joined #ocaml
logicgeezer has joined #ocaml
r126f has joined #ocaml
yroeht has joined #ocaml
r126f has quit [Client Quit]
ousado has quit [Changing host]
ousado has joined #ocaml
silver has quit [Quit: I put on my robe and wizard hat]
avsm has joined #ocaml
r126f has joined #ocaml
rby_ has joined #ocaml
letrec has quit [Ping timeout: 255 seconds]
Tobu has quit [Ping timeout: 248 seconds]
rby has quit [Ping timeout: 245 seconds]
Tobu has joined #ocaml
avsm has quit [Quit: Leaving.]
ulfdoz has quit [Read error: Connection reset by peer]
benytc has quit [Quit: Lost terminal]
ulfdoz has joined #ocaml
beckerb has quit [Quit: Konversation terminated!]
cago has quit [Quit: Leaving.]
Vinnipeg has joined #ocaml
avsm has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
ulfdoz has joined #ocaml
antegallya has quit [Ping timeout: 240 seconds]
mdelaney has joined #ocaml
logicgeezer has quit [Ping timeout: 252 seconds]
Cyanure has quit [Ping timeout: 245 seconds]
srcerer has quit [Ping timeout: 248 seconds]
Vinnipeg has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
mdelaney has quit [Quit: mdelaney]
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 245 seconds]
metasyntax|work has joined #ocaml
iago has quit [Quit: Leaving]
olauzon has joined #ocaml
mdelaney has joined #ocaml
Tobu has quit [Ping timeout: 252 seconds]
othiym23 has joined #ocaml
Tobu has joined #ocaml
mdelaney has quit [Quit: mdelaney]
mdelaney has joined #ocaml
srcerer has joined #ocaml
ikaros has joined #ocaml
mdelaney has quit [Quit: mdelaney]
mdelaney has joined #ocaml
BiDOrD_ has quit [Ping timeout: 256 seconds]
czro has joined #ocaml
mdelaney has quit [Quit: mdelaney]
mdelaney has joined #ocaml
metasyntax|work has quit [Quit: WeeChat [quit]]
_andre has quit [Quit: leaving]
twittard has quit [Quit: twittard]
flux has quit [*.net *.split]
olasd has quit [*.net *.split]
flux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
olasd has joined #ocaml
olasd has quit [Changing host]
olasd has joined #ocaml
emmanuelux has joined #ocaml
twittard has joined #ocaml
mariano has joined #ocaml
BiDOrD has joined #ocaml
BiDOrD has quit [Ping timeout: 248 seconds]
NaCl has quit [Quit: brb]
NaCl has joined #ocaml
NaCl has quit [Changing host]
NaCl has joined #ocaml
czro has quit [Ping timeout: 252 seconds]
iago has joined #ocaml
Snark has quit [Quit: Quitte]
twittard_ has joined #ocaml
twittard has quit [Ping timeout: 252 seconds]
twittard_ is now known as twittard
ulfdoz has quit [Ping timeout: 252 seconds]
avsm has quit [Quit: Leaving.]
Xizor has joined #ocaml
thomasga has quit [Quit: Leaving.]
Tobu has quit [Ping timeout: 248 seconds]
twittard has quit [Ping timeout: 260 seconds]
twittard has joined #ocaml
twittard has quit [Quit: twittard]
twittard has joined #ocaml
twittard has quit [Read error: Connection reset by peer]
twittard has joined #ocaml
edwin has quit [Remote host closed the connection]
Tobu has joined #ocaml
BiDOrD has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
antegallya has joined #ocaml
Drup has quit [Quit: Leaving.]
antegallya has quit [Client Quit]
twittard has quit [Remote host closed the connection]
twittard has joined #ocaml
letrec has joined #ocaml
mariano has quit [Quit: Leaving]
othiym23 has quit [Ping timeout: 252 seconds]
BiDOrD has quit [Ping timeout: 252 seconds]
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
olauzon has quit [Quit: olauzon]
othiym23 has joined #ocaml
sgnb has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
twittard_ has joined #ocaml
twittard has quit [Ping timeout: 276 seconds]
twittard_ is now known as twittard
letrec has quit [Ping timeout: 252 seconds]
srcerer has quit [Ping timeout: 248 seconds]
Xizor has quit []
mdelaney is now known as mdelaney-afk
emmanuelux has quit [Remote host closed the connection]
ftrvxmtrx_ has quit [Ping timeout: 244 seconds]
ftrvxmtrx_ has joined #ocaml
asdfhjkl has quit [Quit: Leaving]
iago has quit [Quit: Leaving]