Syntax¶
Postfix application (//)¶
expr // f is equivalent to f[expr].
The // operator has the lowest precedence, so it applies to the entire
left-hand expression.
Postfix after an operator chain:
Postfix with a curried function call:
Chained postfix:
Prefix application (@) with comparison operators¶
@ has higher precedence than ==, so f@x == y means (f@x) == y.
Rule (->) and RuleDelayed (:>) as general operators¶
-> creates a rule, and :> creates a delayed rule.
These can be used anywhere in expressions, not just in replacement contexts.
Multi-index Part extraction ([[i, j]])¶
expr[[i, j]] extracts nested parts: first part i, then part j from the result.
$ wo 'FullForm[a[[1,2,3]]]'
Part::partd: Part specification a[[1,2,3]] is longer than depth of object.
.* (regex*)
Part[a, 1, 2, 3]
Increment (++) and Decrement (--)¶
x++ increments x by 1 and returns the old value.
x-- decrements x by 1 and returns the old value.
Part Assignment¶
Assigning to a Part expression modifies the list in-place.
Rule Pattern Evaluation¶
Both sides of -> (Rule) are evaluated.
Stored Anonymous Functions¶
Anonymous functions can be stored in variables and called later.
Nested Function Slot Scoping¶
Slots (#) bind to the innermost & (Function).
Alternatives (|)¶
The | operator represents alternatives in pattern matching.