bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] A couple of bugs, and a question on the power operator


From: Jay Foad
Subject: Re: [Bug-apl] A couple of bugs, and a question on the power operator
Date: Mon, 15 Aug 2016 09:24:48 +0100

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

[Prev in Thread] Current Thread [Next in Thread]