With an expression like
X := (PARM = 6) / 3
depending on the value of the boolean condition, the result of the
compression can be two things:
If true, X is a one element vector. 1 / scalar is a vector
If false, X is an empty vector, like iota zero. 0 / scalar is an
empty numeric vector, same as iota 0.
Most APLs have a symbol for this, the Zilde, zero overstruck with a
not sign (called a tilde, hence zilde). It is identical to iota 0.
My usual test for emptyness is 0 element rho X.
There are types of nothings. If you have a nested array and do a 0/
of it, it is an empty vector, but there is prototype information
stored. Caution: Different APLs treat this differently.
Also, a character empty is the not the same as a numeric empty. A
character nothing is ''.
Zilde == '' is false (match function)
Generally you don't have to pay attention to scalars vs. one element
vectors with things like normal branches. However, with the Case
statement, the shape does matter.
In APL, there is no such thing as "Nothing". Instead, there is VALUE
If you have a scalar and want a vector, ,X
If you have a vector and want the first element as a scalar, take X.
(Monadic take, the up arrow)
In the old days,
(iota 0) rho X
would give you the first element of a vector as a scalar. The shape
of a scalar is iota 0
'' rho X
would do the same.