>
> thanks, I see. If I read your examples correctly then Dyalog has a special
> syntax {A} to mark the left argument A
> of a defined function as optional and, as a consequence, to declare a
> function as ambivalent.
>

Right. In Dyalog tradfns can be monadic, dyadic or ambivalent; dfns are
always ambivalent.

In GNU APL (and I believe also in IBM APL2) every defined dyadic function
> is automatically ambivalent,
> and therefore there is not difference between a defined ambivalent
> function and a defined dyadic function.
>

The APL2 manual says that monadic defined functions are strictly monadic,
but "dyadic" functions are really ambivalent and you should be prepared for
the function not to receive any left argument:

      ∇r←f y
[1]   r←y>10
[2]   ∇

      ∇r←x g y
[1]   r←y>10
[2]   ∇

      f 4
0
      3 f 4
VALENCE ERROR

      g 4
0
      3 g 4
0

Jay.

Reply via email to