Expand/Shrink

Expressions

Like other programming languages, Phix lets you calculate results by forming expressions. However, in Phix you can perform calculations on entire sequences of data with one expression, where in most other languages you would have to construct a loop. In Phix you can handle a sequence much as you would a single number. It can be copied, passed to a subroutine, or calculated upon as a unit. For example,
     sq_add({1,2,3},5)
is an expression that adds the sequence {1,2,3} and the atom 5 to get the resulting sequence {6,7,8}.

We will see more examples later.