Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
24
Task/Arrays/Lambdatalk/arrays.lambdatalk
Normal file
24
Task/Arrays/Lambdatalk/arrays.lambdatalk
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// Create a new array with length 0
|
||||
{def myArray1 {A.new}}
|
||||
-> []
|
||||
|
||||
// Create an array with 2 members (length is 2)
|
||||
{def myArray2 {A.new Item1 Item2}}
|
||||
-> [Item1,Item2]
|
||||
|
||||
// Edit a value in an array
|
||||
{def myArray3 {A.new 1 2 3}}
|
||||
{A.set! 1 hello {myArray3}}
|
||||
-> [1,hello,3]
|
||||
|
||||
// Add a value at the head of an array
|
||||
{def myArray4 {A.new 1 2 3}}-> myArray4
|
||||
{A.addfirst! hello {myArray4}}
|
||||
-> [hello,1,2,3]
|
||||
|
||||
// Add a value at the tail of an array
|
||||
{def myArray5 {A.new 1 2 3}}
|
||||
{A.addlast! hello {myArray5}}
|
||||
-> [1,2,3,hello]
|
||||
|
||||
and so on...
|
||||
Loading…
Add table
Add a link
Reference in a new issue