zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
ygrek has quit [Ping timeout: 276 seconds]
ygrek has joined #ocaml
zerbob has joined #ocaml
codesnow has joined #ocaml
djcoin has joined #ocaml
ikaros has joined #ocaml
KDr2 has quit [Remote host closed the connection]
dsheets has quit [Read error: Connection timed out]
dsheets has joined #ocaml
<Drakken>
omygosh, ocaml has _three_ ways to do multiple bindings.
<Drakken>
let/and uses previous bindings, even if one of the new names shadows one of the old ones.
datkin has quit [Read error: Connection reset by peer]
<Drakken>
let rec/and uses the new bindings.
<Drakken>
and let/in uses new bindings linearly.
dsheets has quit [Read error: Connection timed out]
dsheets has joined #ocaml
zerbob has quit [Ping timeout: 245 seconds]
sander has joined #ocaml
dsheets has quit [Read error: Connection timed out]
dsheets has joined #ocaml
letrec_ has quit [Ping timeout: 244 seconds]
lamawithonel has quit []
codesnow has quit [Ping timeout: 246 seconds]
<iZsh>
Drakken: I usually use "and" only with "rec" (in other words when I need mutually recursive bindings)
<iZsh>
otherwise I always use "let … in" because it's easier to copy/paste-move statements around
lamawithonel has joined #ocaml
lamawithonel has quit [Ping timeout: 276 seconds]
<Drakken>
iZsh that seems to be the convention. let/and is equivalent to LET in Lisp, so maybe that's why it was included.
MaskRay has quit [Remote host closed the connection]
Tobu has quit [Ping timeout: 272 seconds]
<antoineB>
hello, i can't use Std.input_list function
<antoineB>
i haved installed extLib and add '#load "extlib/extLib.cma" ;;' on the command line
Tobu has joined #ocaml
iago has joined #ocaml
<thelema_>
antoineB: "open ExtLib"?
<thelema_>
Drakken: let..in isn't multiple bindings. only let..and...in is multiple bindings. Yes, there are two flavors of that: recursive and non-recursive, whether you're making a set of mutually recursive values (I believe this is the real motivation for the 'and') and without rec, which is rarely used, but could indicate potential for parallel evaluation.
<Drakken>
thelema I mean multiple consecutive let/ins. let .. in let ... etc. is equivalent to LET* in Lisp.
<Drakken>
I mean thelema_
<thelema_>
Drakken: well, okay... But then there's 4; let rec ... in
<Drakken>
thelema_ that's nested. I'm just trying to figure out all possible semantics behind linear sequences of binding terms.
<thelema_>
with let...and...in, there's no linearity - all are bound at once.
<Drakken>
Lisp only has LET and LET* for nonfunctional values, and Haskell only has one kind of let expression.
<thelema_>
same with let rec
<Drakken>
I mean they're syntactically linear.
<thelema_>
ocaml has two kinds> let rec ... [and ...] in, let ... [and ...] in
<thelema_>
technically only the first is needed, but the second is available, as it's commonly useful to rebind an identifier
<thelema_>
(not necessarily great practice, but can be nice to shadow old values so they can't be used)
<iZsh>
I use shadowing all the time :)
<Drakken>
right. I've been thinking about ways to design a new language with syntax somewhat like Haskell's multiple-binding let form, and I just wanted to make sure I know what OCaml has.
<Drakken>
in terms of semantics
<iZsh>
what's the language for?
<Drakken>
satiating my idle curiosity :)
<thelema_>
ocaml has recursive groups and non-recursive groups. Just because a group can be a singleton...
<iZsh>
Drakken: I mean, is it a domain specific language ?
<Drakken>
iZsh no. There are just so many features in so many different languages that I like, that I'd like to put them all together into one language.
<iZsh>
good luck :)
<antoineB>
thelema_: Unbound module
<thelema_>
antoineB: any reason you're using extlib over batteries?
<antoineB>
no
<thelema_>
I'm not as sure on extlib's structure, but all its functionality has been merged into batteries. (except compression)
<antoineB>
thelema_: i don't manage to use BatFile