The "Unknown:"s below indicate that an entry is incomplete.
nothing needed | breaking lines (useful when end-of-line and/or indentation has a special meaning) |
# | commenting (until end of line) |
< > <= >= | comparison |
min / max | comparison (min / max (binary or more)) |
= != | equality / inequality (deep) |
= <> | equality / inequality (shallow) |
gc | force garbage collection |
( ... ) | grouping expressions |
case-sensitive | tokens (case-sensitivity (keywords, variable identifiers...)) |
[_a-zA-Z][_a-zA-Z0-9]* | tokens (variable identifier regexp) |
proc() .. end proc | use a block as a return value (when statements are not expressions) |
:= | variable assignment or declaration (assignment) |
Unknown:
information about the current line and file
tokens (what is the standard way for scrunching together multiple words)
comparison (returns 3 values (i.e. inferior, equal or superior))
runtime evaluation
(a, b) -> ... | anonymous function |
f(a,b,...) | function call |
f() | function call (with no parameter) |
@ | function composition |
f := (para1, para2, ...) -> ... | function definition |
f := proc(para1, para2, ...) ... end proc | function definition (procedures) |
return(1) | function return value (breaks the control flow) |
no syntax needed(2) | function return value (function body is the result) |
where(2) | runtime inspecting the caller information |
Unknown:
function called when a function is not defined (in dynamic languages)
next / break(3) | breaking control flow (continue / break) |
return(1) | breaking control flow (returning a value) |
try a catch exn: ... end try | exception (catching) |
finally | exception (cleanup: code executed before leaving) |
error | exception (throwing) |
if c then ... end if | if_then |
if c then ... fi | if_then |
if c then b1 elif c2 then b2 else b3 end if | if_then_else |
for i from 10 to 1 by -1 do ... end do | loop (for each value in a numeric range, 1 decrement) |
for i from 1 to 10 do ... end do | loop (for each value in a numeric range, 1 increment (see also the entries about ranges)) |
for i from 1 to 10 by 2 do ... end do | loop (for each value in a numeric range, free increment) |
while c do ... end do | loop (while condition do something) |
; | sequence |
: | sequence |
p = module() ... end module | declare |
p = module() export name1, name2, ...; ... end module | declare (selective export) |
with(p) | import (package (ie. load the package)) |
with(p[name1, name2,]) | import (selectively) |
:- | package scope |
s[n] | accessing n-th character |
StringTools[Char] | ascii to character |
"z" | character "z" |
StringTools[Ord] | character to ascii |
convert(e,string) | convert something to a string (see also string interpolation) |
cat(s$n) | duplicate n times |
s[n..m] | extract a substring |
StringTools[Search] | locate a substring |
StringTools[SearchAll](s,p)[-1] | locate a substring (starting at the end) |
all strings allow multi-line strings | multi-line |
simple print (on strings) | |
printf | simple print (printf-like) |
sprintf | sprintf-like |
|| | string concatenation |
cat | string concatenation |
= != | string equality & inequality |
length | string size |
"\n" | strings (end-of-line (without writing the real CR or LF character)) |
"..." | strings (with no interpolation of variables) |
string | type name |
StringTools[UpperCase] / StringTools[LowerCase] / StringTools[Capitalize] | uppercase / lowercase / capitalized string |
Unknown:
serialize (marshalling)
unserialize (un-marshalling)
upper / lower case character
false | false value |
FAIL | false value |
not(4) | logical not |
or / and | logical or / and (non short circuit (always evaluates both arguments)) |
true | true value |
boolean | type name |
[e l[]] | adding an element at the beginning (list cons) (return the new list (no side-effect)) |
foldl | f(... f(f(init, e1), e2) ..., en) |
foldr | f(e1, f(e2, ... f(en, init) ...)) |
ListTools[Search] | find an element |
for v in l ... | for each element do something |
ormap | is the predicate true for an element |
andmap | is the predicate true for every element |
ListTools[Join] | join a list of strings in a string using a glue string |
select | keep elements (matching) |
, | list concatenation |
[ a, b, c ](5) | list constructor |
ListTools[FlattenOnce] | list flattening (one level depth) |
ListTools[Flatten] | list flattening (recursive) |
zip | list of couples from 2 lists |
nops | list size |
a[i] | list/array indexing |
a[e] | lookup an element in a association list |
ListTools[MakeUnique] | remove duplicates |
ListTools[Reverse] | reverse |
min / max | smallest / biggest element |
sort(6) | sort |
ListTools[Split] | split a list (into sublists delimited by elements matching a predicate) |
map | transform a list (or bag) in another one |
Zip | transform two lists in parallel |
list | type name |
h[k] | dictionary (access: read/write) |
table([a=b, c=d]) | dictionary (constructor) |
keys | dictionary (list of keys) |
entries | dictionary (list of values) |
table | dictionary (type name) |
NULL | optional value (null value) |
r[field] | record (selector) |
'' | reference (pointer) (creation) |
eval | reference (pointer) (dereference) |
Unknown:
tuple constructor
computable tuple (these are a kind of immutable lists playing a special role in parameter passing) (empty tuple)
computable tuple (these are a kind of immutable lists playing a special role in parameter passing) (1-uple)
computable tuple (these are a kind of immutable lists playing a special role in parameter passing) (using a tuple for a function call)
optional value (value)
optional value (null coalescing)
dictionary (remove by key)
dictionary (merge)
+ / - / * / / | addition / subtraction / multiplication / division |
**, ^ | exponentiation (power) |
log[10] | logarithm (base 10) |
ln | logarithm (base e) |
log | logarithm (base e) |
- | negation |
1000., 1E3 | numbers syntax (floating point) |
1000 | numbers syntax (integers) |
mathematical | operator priorities and associativities (addition vs multiplication) |
mathematical | operator priorities and associativities (exponentiation vs negation (is -3^2 equal to 9 or -9)) |
rand | random (random number) |
RandomTools[MersenneTwister][SetState] | random (seed the pseudo random generator) |
sqrt / exp / abs | square root / e-exponential / absolute value |
sin / cos / tan | trigonometry (basic) |
arcsin / arccos / arctan | trigonometry (inverse) |
trunc / round / floor / ceil | truncate / round / floor / ceil |
float | type name (floating point) |
integer | type name (integers) |
Unknown:
numbers syntax (integers in base 2, octal and hexadecimal)
modulo
bitwise operators