<ania123>
let x = 5 in e;; program ocaml substitutes every occurrence of x in e by 5 and evaluates obtained e
<ania123>
let foo x = e1 in foo 0 does smt conceptually different, foo 0 will be called, that means evert occurrence of x in e1 will be replaced by 0 and obtained e1 will be evaluated
<ania123>
I have problems to reasonable understand its concepts
<octachron>
Why do you think the two are different?
<ania123>
in first program we just substitute value of x in e1
<ania123>
and it is clear to me....
<octachron>
And the second one, the same thing happens when applying `foo` to an argument.
<ania123>
in the second one we evaluate e1 when foo function gets argument 0
ania123 has quit [Quit: Client closed]
ania123 has joined #ocaml
<ania123>
hi all
<ania123>
in the second one we evaluate e1 when foo function gets argument 0
<octachron>
That's correct. You should try to describe what you don't understand.
myrkraverk_ has quit [Ping timeout: 268 seconds]
<ania123>
let foo x = e1 in e2. intuition in this program is not clear to me...
<ania123>
could you give me link to find it please? where I can see explanation?
<ania123>
octachron: could you please, give me a link where I can find intuition behind it...
waleee has quit [Ping timeout: 252 seconds]
<octachron>
You should try to describe what you have troubles to understand. Intuition is more trained than found.
<octachron>
For instance, `let f x = 1 + x`, `f 0` means replace `x` by `0` in `1 + x` which gives `1 + 0` which is reduced to `1`.
waleee has joined #ocaml
waleee has quit [Ping timeout: 260 seconds]
ania123 has quit [Ping timeout: 250 seconds]
Serpent7776 has quit [Ping timeout: 272 seconds]
<dh`>
in "let foo x = e1 in foo 0" you substitute foo into foo 0
<dh`>
which gives you "(fun x = e1) 0" which then in turn reduces to e1 with x replaced by 0
<dh`>
calls aren't different, at least in the basic lambda calculus formation
<dh`>
s/formation/formulation/
waleee has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
boozec has quit [Quit: boozec]
pi3ce has quit [Quit: No Ping reply in 180 seconds.]