Scalars | 123, null, true, false, "symbol", "+" |
Strings | ["`", "quoted symbol is a string"] |
List | [7, 8, 9] |
Objects | {"a": 123, "b": 789} |
Calling | ["+", 2, 3] |
Anonymous | ["fn", ["a"], ["+", 2, "a"]] |
Named | ["def", "inc2", ["fn", ["a"], ["+", 2, "a"]]] |
Higher Order | ["map", "inc2", ["list", 2,3,4]] |
Variadic | ["def", "drop1", ["fn", ["a", "&", "b"], "b"]] |
Math | "+", "-", "*", "/" |
Conditional Macros | "and", "or" |
Comparison/Boolean | "=", "<", ">", "<=", ">=", "not" |
Predicates | "null?", "true?", "false?", "string?", "list?", "contains?", "empty?" |
List Functions | "map", "apply", "list", "cons", "concat", "nth", "first", "last", "rest", "count", "empty?" |
Object Functions | "get", "set", "contains?", "keys", "vals" |
String Functions | "str", "pr-str", "prn", "println" |
Other | "throw" |
Conditional | ["if", [">", 3, 2], 7, 8] |
Multiple Actions (side-effects) |
["do", ["prn", 123], 456] |
Environment Bindings | ["def", "x", 123] ["let", ["y", 456], ["*", 2, "y"]] |
Quote | ["`", ["prn", 123]] |
Error Handling | ["try", "abc", ["catch", "e", ["prn", "e"]]] |
Macros | ["def","unless",["~",["fn",["p","a","b"], ["list",["`","if"],"p","b","a"]]]] |
Read | ["read",["`", "[\"+\", 2,3]"]] |
Eval | ["eval",["`", ["+", 2,3]]] |
Evaluate JavaScript | ["js", ["`", "2 + 3"]] |
Method call | [".", "Object", ["`", "keys"], {"a": 1}] |
Get attribute | [".-", "Math", ["`", "PI"]] |
Set attribute | [".-", "window", ["`", "location"], ["`", "http://github.com"]] |
Delete attribute | ["del", "window", ["`", "console"], |
Object Class | ["classOf", 123] |
Inheritance Test | ["isa", {}, "Object"] |
Instantiate Object | ["new", "Array", 3] |