tav has quit [Read error: 104 (Connection reset by peer)]
tav` has joined #ocaml
tav` has quit [Read error: 110 (Connection timed out)]
tav has joined #ocaml
smkl has quit [Read error: 104 (Connection reset by peer)]
smkl has joined #ocaml
sombrero has joined #ocaml
Yurik has joined #ocaml
inv has joined #ocaml
<inv>
anybody alive ?
<Yurik>
yep
<inv>
hi
<inv>
tut vsegda tol'ko ti zivoy ? :)
<Yurik>
nope, not only /me is always alive here ;)
<inv>
daze ne znau kuda napisat' po-povodu lablgtk pod windows
<Yurik>
ocaml-list?
<inv>
ti lablgtk sluchayno ne kopiliroval pod windows ?
<Yurik>
kompilit' - ne kompilil... a problemy s ocamlbrowser'om (on zhe vrode na labltk ) pod windows - ispyatyvayu - padaet
inv has quit ["Leaving"]
olczyk has joined #ocaml
tolczyk has joined #ocaml
olczyk has quit []
tolczyk has quit []
Yurik has quit [Read error: 95 (Operation not supported)]
gl has joined #ocaml
Yurik has joined #ocaml
gl has quit [Remote closed the connection]
graydon has joined #ocaml
gl has joined #ocaml
Yurik has quit ["Client Exiting"]
Yurik has joined #ocaml
ftaiani has joined #ocaml
ftaiani has left #ocaml []
olczyk has joined #ocaml
<olczyk>
I'm having a problem with some SML code in Wadlers "how to Declare an Imperative."
<olczyk>
let val
<olczyk>
x=(putcML #"h";putcML #"h")
<olczyk>
in x; x end
<olczyk>
Doesn't look like the little ML I know.
<olczyk>
Can someone help me understand whats going on?
sombrero has quit [Read error: 104 (Connection reset by peer)]
<smkl>
hmm
<smkl>
seems correct, except that i don't remember what putcML is really called in SML
<smkl>
that code is probably supposed to demonstrate that (putcML #"h";putcML #"h") is executed only once
<olczyk>
Yes that's right.
<olczyk>
putcML is something I think he made up.
<olczyk>
It's supposed to print a single character.
<olczyk>
I'm not sure what in x is supposed to do here.
<smkl>
it is just "let ... = ... in ..." construct
<olczyk>
The in x means that it is local to x. But I don't understand what local to x means.
<olczyk>
I also don't understand what end means.
<smkl>
in "let x = y in b", variable x is bound to y only in b, after that the binding is forgotten
<smkl>
i guess it is just part of SML's let-syntax
<olczyk>
That's what I mean. IT seems to say x is bound to (...) only in x.
<olczyk>
That doesn't make sense.
<smkl>
in this case, it's bound in "x ; x"
<olczyk>
Ahh. SO if I type x;x later this is substitued for x.
<olczyk>
And since it is assigned to a variable the "action" is only taken once.
<olczyk>
down a little later he substitutes f () for x.
<smkl>
the action is done when x is bound to (putcML #"h";putcML #"h"), which evaluates to "()"
<smkl>
he probably changed "let val x" to "let fun f ()" too
<olczyk>
Yeah. He did.
<olczyk>
Now if I type x;x
<olczyk>
and then x;x
<olczyk>
it still only prints Ha once?
<smkl>
you mean "x;x;x;x"? yes, no side-effects can happen there, because x just evaluates to it's value
<olczyk>
Does it print Ha imediately after the let, or after the first x; ( I would try it
<olczyk>
in caml or sml, but they dont seem to like it. )
<olczyk>
Probably old syntax.
<smkl>
actually during the let. so "let x = ... in ()" would be just the same
<olczyk>
Thanks it was the end forcing the x;x to be treated as an expression that confused me. I thought the ; meant that x was the "local expression".
Yurik has quit ["Client Exiting"]
olczyk has quit []
skylan has quit [Read error: 104 (Connection reset by peer)]
skylan has joined #ocaml
jao has joined #ocaml
kjs3 has joined #ocaml
gl has quit ["Client Exiting"]
gl has joined #ocaml
skylan has quit [Read error: 104 (Connection reset by peer)]
skylan has joined #ocaml
Taaus_ has joined #ocaml
Taaus has quit [Read error: 104 (Connection reset by peer)]