Dyalog Primer - Primitive Operators
(3 4⍴⍳12)+.×4 3⍴⍳12
(3 4⍴⍳12)+.=4 3⍴⍳12
2 1⌷¨'abc' 'def'
are distinct from functions:
take data as arguments and return data as results
take data and/or functions as operands, producing a derived function;
the derived function returns data as a result
are fewer primitive operators than there are primitive functions.
syntax of operators is a little less consistent than the syntax of
the value of abstraction - inner product is a much more valuable
construct than having a "matrix multiply" primitive, for example.
at when and how you use "each" - it implies a loop and you may be
falling into scalar thinking.
- Purists may quibble about Dyalog's Modified Assignment operator (is Assignment strictly a function?)
- Dyalog Language Reference
- Operator Syntax
- Commute Each Reduction Span Spawn
- Axis Composition Inner Product Outer Product
- Modified Assignment
- Given a matrix a, write an expression equivalent to (1+⍴a)⍴a which does not contain parentheses
a character matrix a, write an expression which returns 1 for each row
which matches a given vector w (assume that a and w are appropriately
- Each is "handy" but can lead to "pepperpot code such as +/¨⍳¨2 4 6, use the Compose operator to write an equivalent statement containing only a single Each
expressions to add a (correctly-shaped) vector to each row of a matrix,
and another expression to add a vector to each column
- Write an expression which returns a 1 for every row of a character matrix which contains a (shorter) character vector.