all tasks

This commit is contained in:
Ingy döt Net 2013-04-11 01:07:29 -07:00
parent b83f433714
commit 68f8f3e56b
14735 changed files with 178959 additions and 0 deletions

View file

@ -0,0 +1,2 @@
def x := 1
x + x # returns 2

View file

@ -0,0 +1,3 @@
def var x := 1
x := 2
x # returns 2

View file

@ -0,0 +1,7 @@
def var x := 1
x += 1 # equivalent to x := x + 1, or x := x.add(1)
x # returns 2
def var list := ["x"]
list with= "y" # equivalent to list := list.with("y")
list # returns ["x", "y"]

View file

@ -0,0 +1 @@
def [hair, eyes, var shirt, var pants] := ["black", "brown", "plaid", "jeans"]

View file

@ -0,0 +1 @@
[shirt, pants] := ["white", "black"] # This does not do anything useful.

View file

@ -0,0 +1,2 @@
def list := [def x := timer.now(), x] # two copies of the current time
list[0] == x # x is still visible here; returns true

View file

@ -0,0 +1,10 @@
def makeSum() {
var a := 0
var b := 0
return [&a, &b, fn { a + b }]
}
def [&x, &y, sum] := makeSum()
x := 3
y := 4
sum() # returns 7

View file

@ -0,0 +1,8 @@
def getUniqueId(&counter) {
counter += 1
return counter
}
var idc := 0
getUniqueId(&idc) # returns 1
getUniqueId(&idc) # returns 2