@Setsize - Set Indexing
Syntax
@SETSIZE
Use
The @Setsize directive generates a number corresponding to the number of elements in the expression, which must be a set. This directive is useful for set indexing operations.
Example
@setsize [a,b,c]
generates the number 3.
For set indexing, the @Setsize directive can be used in macros as follows:
high macro (s) {?s[@setsize(?s); -1..@setsize(?s);/2-1};
The high macro returns the upper half of a set of any size (the high 4 bits of an 8-bit set, for example).