mrvn has quit [Read error: 60 (Operation timed out)]
mattam has quit ["zzzzzzZZZZZZZzzzzz"]
gl has quit [Read error: 54 (Connection reset by peer)]
lament has quit [Excess Flood]
nkoza has quit [Read error: 60 (Operation timed out)]
engstad has joined #ocaml
engstad has quit ["Leaving"]
lyn has joined #ocaml
skylan has quit [forward.freenode.net irc.freenode.net]
skylan has joined #ocaml
lyn has quit [forward.freenode.net irc.freenode.net]
Torquema1a has quit [forward.freenode.net irc.freenode.net]
asqui has quit [forward.freenode.net irc.freenode.net]
Torquemada has joined #ocaml
asqui has joined #ocaml
skylan has quit [forward.freenode.net irc.freenode.net]
skylan has joined #ocaml
skylan has quit [forward.freenode.net irc.freenode.net]
skylan has joined #ocaml
lament has joined #ocaml
skylan has quit [forward.freenode.net irc.freenode.net]
skylan has joined #ocaml
gl has joined #ocaml
<gl>
'lo
mrvn has joined #ocaml
mattam has joined #ocaml
graydon has quit ["xchat exiting.."]
__mattam__ has joined #ocaml
mattam has quit [Read error: 113 (No route to host)]
gl has quit [Read error: 104 (Connection reset by peer)]
lament has quit ["mental mantle"]
mrvn has left #ocaml []
Hellfried has joined #ocaml
mattam has joined #ocaml
mrvn has joined #ocaml
__mattam__ has quit [Read error: 60 (Operation timed out)]
Hellfried has quit ["leaving"]
asqui has quit [Connection timed out]
skylan has quit ["bbl"]
lam_ has quit [Read error: 104 (Connection reset by peer)]
lam has joined #ocaml
lam has quit ["leaving"]
TachYon25 has joined #ocaml
graydon has joined #ocaml
lam has joined #ocaml
TachYon25 has quit ["bez ki³y nie ma zaliczenia (z prawd studentek AM)"]
nkoza has joined #ocaml
lam has quit ["leaving"]
lam has joined #ocaml
gl has joined #ocaml
Dalroth has joined #ocaml
MegaWatS has joined #ocaml
asqui has joined #ocaml
keithr2 has joined #ocaml
<keithr2>
I began reading a book last night - "A Functional Approach to Programming" -- I am trying to understand what is functional programming. -- The book uses CAML -- I understood from my reading that one would like to avoid using assignment because correctness is sacrificed. (?) -- Anyway in the intro to CAML the author introduces variables and their declarations -- > let x = 2+3;; -- is that not an assignment?
<mrvn>
No, thats a binding.
<kev>
I take it by 'assignment' the term means functions with side effects?
<mrvn>
let x = 7 let _ = let x = 7 in x let _ print_int x;;
<mrvn>
s/print/= print/
<mrvn>
assignment is a sideeffekt.
<MegaWatS>
keithr: no binding works more like constant assignment
<mrvn>
Assignment would mean that you assign a new value to the old x.
<MegaWatS>
when you "re-assign", you only shadow out the old value
<kev>
okay, so I have absolutely no clue how to parse that ;)
<MegaWatS>
i.e.
<MegaWatS>
let x = 2
<MegaWatS>
and then late
<MegaWatS>
let x = 3
<MegaWatS>
is more like
<MegaWatS>
const x = 2; foo() { const x = 3; ... }
<MegaWatS>
than like
<MegaWatS>
int x = 2; foo() { x = 3; ... }
<MegaWatS>
ie the old binding still exists - you can`t change it`s value - you only shadowed it out of the current namespace
karryall has quit []
<mrvn>
The main thing is probably that you know that nothing will change your varibale no matter what function you call. You can only change it yourself by shadowing it with a new one.
<mrvn>
Makes it possible to proff something works without looking at all the functions it calls closelz.
<mrvn>
mep: The one you intend to use.
<mrvn>
Try libglib2.0-dev.
<mrvn>
ups
gl has quit [Read error: 54 (Connection reset by peer)]
<keithr2>
ok -- a binding is not an assignment -- let x = 2+3;; is a binding -- I can create another binding > let x = 5+6;; but the x is not the same variable ( provided I used the right structure) -- that is one would never see those two expressions within the same block of code -- correct?
<MegaWatS>
why not? you can shadow it in the same block of code
<MegaWatS>
look at the following piece of C++ code:
<MegaWatS>
for(;;) { const x = 3; int y; { const x = 4; y = x; } cout << x << " " << y; }
<MegaWatS>
which is different from for(;;) { int x = 3; int y; x = 4; y = x; cout << x << " " << y; }
gl has joined #ocaml
<MegaWatS>
or especially the difference between the following two: int x = 2; for(;;) { x = x + 1; if(x >= 10) break; } and const x = 2; for(;;) { int y = x + 1; const x = y; if(x >= 10) break; }
<MegaWatS>
so you CAN have two let bindings to the same variable in the same block
<MegaWatS>
they will shadow each other: let x = 2 in let x = 3 in [... ]
<MegaWatS>
you can even do let x = 2 in let x = x + 1 in
<MegaWatS>
as the expression on the RHS can refer to the old value
<keithr2>
:) ok
<MegaWatS>
but each let binding creates a new variable with a new scope
<MegaWatS>
ie let ... is like { const ... = ...; ... } , including the braces - it automatically already creates the new scope
<keithr2>
thanks
skylan has joined #ocaml
mattam has quit ["irssi -> erc"]
keithr2 has quit [Remote closed the connection]
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
gl has quit [Remote closed the connection]
gl has joined #ocaml
MegaWatS has quit ["Don't you hate it when chicks get mad at you for staring at their asses? It's not my fault that they have stuff written there]
gl has quit [Remote closed the connection]
MegaWatS has joined #ocaml
gl has joined #ocaml
j_bravo has joined #ocaml
MegaWatS has quit ["Don't you hate it when chicks get mad at you for staring at their asses? It's not my fault that they have stuff written there]
mmc has quit [Read error: 104 (Connection reset by peer)]
nkoza has quit [Read error: 110 (Connection timed out)]
SoreEel has quit [Read error: 104 (Connection reset by peer)]