Function Trains

A Train is a sequence of 2 or 3 functions, or an array followed by two functions, which bind together to form a function.

Note that the right-most item of a function train (which is by definition a function) must be isolated from anything to its right, otherwise it will be bound to that rather than to the items to its left. This is done using parentheses.

For example, the following expression comprises a function train -,÷ that is separated from its argument 2 by parentheses:

      (-,÷) 2
¯2 0.5

and means:

  1. Calculate the reciprocal of 2
  2. Calculate the negation of 2
  3. Catenate these 2 results together

Whereas, without the parentheses to identify the function train, the expression means (as it did before):

  1. Calculate the reciprocal of 2
  2. Ravel the result of step 1
  3. Negate the result of step 2
      -,÷ 2
¯0.5

For further information, see Function Trains.