| phil chastney 2006-10-30, 7:01 pm |
| Phil Last wrote:
> On Oct 25, 10:47 am, phil chastney
> <phil.hates.s...@amadeus-info.munged.freeserve.co.uk> wrote:
>
>
>
> My only problem is the word "if". Without it we have a completely
> normal function expression in which "then" and "else" are operators (or
> in fact the same operator) and "CONDITION", "FOO" and "GOO" are either
> functions on "THETA" or are arrays while "CONDITION" would be expected
> to be/return a boolean singleton. Only one of FOO and GOO get executed.
> see http://www.dyalog.dk/dfnsdws/n_cond.htm
this phrase was not really intended to be read as APL -- first time
around, I prefixed it with the qualifier "along the lines of .."
FOO and GOO are monadic function definitions; CONDITION selects one of
them, and the selected function is applied to its argument THETA -- only
one of FOO THETA and GOO THETA gets executed
'if', 'then' and 'else' could be realised in various ways, but none
of them is required -- if functions were first-class objects, existing
primitives would provide all the necessary power for all control structures
if it helps, just look on 'if' as syntactic sugar, having no nutritional
value -- regards . . . /phil
|