Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Variables/Lambdatalk/variables.lambdatalk
Normal file
22
Task/Variables/Lambdatalk/variables.lambdatalk
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
1) working in a global scope
|
||||
|
||||
{def A 3}
|
||||
-> A // A is in the global scope
|
||||
{def B 4}
|
||||
-> B // B is in the global scopel
|
||||
{def MUL {lambda {:x :y} {* :x :y}}}
|
||||
-> MUL // MUL is a global function
|
||||
{MUL {A} {B}} // using global variables
|
||||
-> 12
|
||||
|
||||
2) working in a local scope
|
||||
|
||||
{let // open local scope
|
||||
{ // begin defining and assigning local variables
|
||||
{:a 3} // :a is local
|
||||
{:b 4} // :b is local
|
||||
{:mul {lambda {:x :y} {* :x :y}}} // :mul is a local function
|
||||
} // end defining and assigning local variables
|
||||
{:mul :a :b} // computing with local variables
|
||||
} // closing local scope
|
||||
-> 12
|
||||
Loading…
Add table
Add a link
Reference in a new issue