Created
March 31, 2011 17:07
-
-
Save Quby/896783 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Blocking scope | |
let(valuse){} | |
for(let values){} | |
//Tuples | |
(val1,val2) | |
//List expressions,range,reduce,guard | |
[a*a | list->a] | |
[1,3..33] | |
[a*b | list->(a,b)] | |
[c=a*c | c=0 list->a] | |
[a*a | list->a, a<10] | |
//Parallel set | |
(a,b) = (b,a) | |
//Static type | |
'2' + 3 //Bad | |
int('2') + 3 //Good int,float,string,bool | |
//Types | |
type List(a){ | |
a:List(a) || null | |
} | |
type Bool(){ | |
True || False | |
} | |
//Define functions | |
def product{ | |
(0:_) = 0 | |
(x:xs) = x * product(xs) | |
(null) = 1 | |
} | |
//Generator,iterator | |
def a(b){ | |
yeild b++; | |
} | |
//Closures | |
def a(b,c) = (lambda() = (b,c)) | |
//Import | |
import moduleName | |
//Structure elements | |
for(...){ | |
} | |
while(...){ | |
} | |
if(...){ | |
}elif(...){ | |
}else{ | |
} | |
//Standart libary | |
stdio | |
socket | |
tk | |
threads |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment