Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Generic-swap/Lambdatalk/generic-swap.lambdatalk
Normal file
17
Task/Generic-swap/Lambdatalk/generic-swap.lambdatalk
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
1) using an Immediately Invoked Function Expression:
|
||||
{{lambda {:x :y} :y :x} hello world}
|
||||
-> world hello
|
||||
|
||||
2) or user defined function
|
||||
{def swap {lambda {:x :y} :y :x}}
|
||||
-> swap
|
||||
|
||||
3) applied on words (which can be numbers)
|
||||
{swap hello world}
|
||||
-> world hello
|
||||
|
||||
{swap hello brave new world}
|
||||
-> brave new hello world
|
||||
|
||||
{swap {cons hello brave} {cons new world}}
|
||||
-> (new world) (hello brave)
|
||||
Loading…
Add table
Add a link
Reference in a new issue