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 (nestable) |
< > <= >= | comparison |
Min / Max | comparison (min / max (binary or more)) |
=== =!= / == !=(1) | equality / inequality (deep) |
( ... ) | grouping expressions |
ToExpression | runtime evaluation |
case-sensitive | tokens (case-sensitivity (keywords, variable identifiers...)) |
[a-zA-Z][a-zA-Z0-9]* | tokens (variable identifier regexp) |
CamelCase or camelCase | tokens (what is the standard way for scrunching together multiple words) |
= | variable assignment or declaration (assignment) |
:= | variable assignment or declaration (assignment) |
Module[{x, y = v}, ... ] | variable assignment or declaration (declaration) |
Block[{x, y = v}, ... ] | variable assignment or declaration (declaration) |
With[{c1 = v1, c2 = v2, ... }, ...] | variable assignment or declaration (declaration) |
Unknown:
information about the current line and file
comparison (returns 3 values (i.e. inferior, equal or superior))
Function[{a, b}, ....](2) | anonymous function |
f[a,b,...] | function call |
f@a(3) | function call |
a // f(3) | function call |
a ~ f ~ b(4) | function call |
f[] | function call (with no parameter) |
Composition | function composition |
f[para1_, para2_, ...] := ... para1 ... | function definition |
f := ... ## & | function definition (variable number of arguments) |
f[params___] := ... params ... | function definition (variable number of arguments) |
Return | function return value (breaks the control flow) |
no syntax needed(5) | function return value (function body is the result) |
Identity | identity function |
Continue / Break | breaking control flow (continue / break) |
Goto | breaking control flow (goto (unconditional jump)) |
Return | breaking control flow (returning a value) |
Catch | exception (catching) |
Throw | exception (throwing) |
If[c, ...] | if_then |
If[c, b1, b2] | if_then_else |
Which[c, b1, c2, b2, True, b3] | if_then_else |
While[...; c] | loop (do something until condition) |
for | loop (for "a la C" (while + initialisation)) |
Do[..., {i, 10, 1, -1}] | loop (for each value in a numeric range, 1 decrement) |
Do[..., {i, 1, 10}](6) | loop (for each value in a numeric range, 1 increment (see also the entries about ranges)) |
Do[..., {i, 1, 10, 2}] | loop (for each value in a numeric range, free increment) |
While[c, ...] | loop (while condition do something) |
Switch[val, v1, ..., v2, ..., _, ...] | multiple selection (switch) |
; | sequence |
Unknown:
loop (forever loop)
_t(7) | annotation (or variable declaration) |
Begin["p`"] ... End[] | declare |
BeginPackage["p`"] ... EndPackage[] | declare |
<< p` | import (everything into current namespace) |
Get["p`"] | import (everything into current namespace) |
Needs["p`"] | import (everything into current namespace) |
` | package scope |
StringTake[s, {n}] | accessing n-th character |
FromCharacterCode | ascii to character |
ToCharacterCode | character to ascii |
ToString | convert something to a string (see also string interpolation) |
StringTake[s, {n, m}] | extract a substring |
StringPosition | locate a substring |
all strings allow multi-line strings | multi-line |
simple print (on any objects) | |
StringJoin | string concatenation |
=== =!= / == !=(1) | string equality & inequality |
StringLength | string size |
"\n" | strings (end-of-line (without writing the real CR or LF character)) |
"..." | strings (with no interpolation of variables) |
ToUpperCase / ToLowerCase | uppercase / lowercase / capitalized string |
Unknown:
character "z"
strings (with interpolation of variables)
serialize (marshalling)
unserialize (un-marshalling)
sprintf-like
duplicate n times
upper / lower case character
locate a substring (starting at the end)
False | false value |
! | logical not |
|| / && | logical or / and (short circuit) |
True | true value |
Transpose | 2 lists from a list of couples |
Insert | adding an element at index (return the new list (no side-effect)) |
Prepend | adding an element at the beginning (list cons) (return the new list (no side-effect)) |
PrependTo | adding an element at the beginning (list cons) (side-effect) |
Append | adding an element at the end (return the new list (no side-effect)) |
AppendTo | adding an element at the end (side-effect) |
Rest | all but the first element |
Most | all but the last element |
Fold | f(... f(f(init, e1), e2) ..., en) |
Position | find an element |
First(8) | first element |
Scan | for each element do something |
MemberQ | is an element in the list |
MapIndexed | iterate with index |
StringJoin @@ Riffle[l, s] | join a list of strings in a string using a glue string |
Select / Case | keep elements (matching) |
Last | last element |
Join | list concatenation |
{ a, b, c }(9) | list constructor |
Flatten | list flattening (recursive) |
Transpose | list of couples from 2 lists |
Length | list size |
a[[i]] | list/array indexing |
/. | lookup an element in a association list |
Union | remove duplicates |
Reverse | reverse |
Min / Max | smallest / biggest element |
Sort | sort |
Split | split a list (into a list of lists of same value) |
Split | split a list (into sublists based on a predicate) |
Map | transform a list (or bag) in another one |
/@ | transform a list (or bag) in another one |
List | type name |
Unknown:
get the first element and remove it
get the last element and remove it
transform two lists in parallel
is the predicate true for an element
is the predicate true for every element
f @@ t | computable tuple (these are a kind of immutable lists playing a special role in parameter passing) (using a tuple for a function call) |
Null(10) | optional value (null value) |
Range | range (inclusive .. inclusive) |
Unknown:
tuple constructor
reference (pointer) (creation)
reference (pointer) (dereference)
optional value (value)
optional value (null coalescing)
record (selector)
dictionary (constructor)
dictionary (access)
dictionary (has the key ?)
dictionary (remove by key)
dictionary (list of keys)
dictionary (list of values)
dictionary (merge)
+ / - / * or nothing / / | addition / subtraction / multiplication / division |
BitAnd / BitOr / BitXor | bitwise operators (and / or / xor) |
BitNot | bitwise operators (bitwise inversion) |
^ | exponentiation (power) |
Log[10, val] | logarithm (base 10) |
Log[2, val] | logarithm (base 2) |
Log | logarithm (base e) |
Mod | modulo (modulo of -3 / 2 is 1) |
- | negation |
1000., 1*^3, 1000` | numbers syntax (floating point) |
2^^1, 8^^7, 16^^f | numbers syntax (integers in base 2, octal and hexadecimal) |
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)) |
Random, RandomReal, RandomInteger | random (random number) |
SeedRandom | 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) |
IntegerPart / Round / Floor / Ceiling | truncate / round / floor / ceil |
Real, Rational | type name (floating point) |
Integer | type name (integers) |