bug-apl
[Top][All Lists]
Advanced

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

Re: Empty arguments


From: Kacper Gutowski
Subject: Re: Empty arguments
Date: Sun, 3 May 2020 13:16:11 +0200

On Sat, May 02, 2020 at 08:13:17PM -0400, Colin Verrilli wrote:
This next one I'm not sure about. Theoretically, it should give the same result as above, but maybe the behavior is different for defined functions.
     ↑ (0↑(1 2)(3 4))f¨(0↑(1 2 3)(4 5 6))
0 0 0
     ⎕cr 'f'
z←l f r
z←l,r

The APL2 LRM makes a big deal about each function having a corresponding
"fill function" that is used when the arguments are empty. It's not clear
about what happens with defined functions.

Defined functions are necessarily different as automatically determining what the function does and what are its properties is not trivial (and not possible in general case); it's a similar problem as with reduction of an empty vector.

Figure 20 at page 110 of the Language Reference shows that for “defined operations”, the fill function is “Z←R (the identity function)”. Note that the description of dyadic each also refers to this this table, and the table clearly says to use right identity, which is what your example shows happening.

Assertion failure with each of scalar functions on empty arguments with prototypes of not matching shapes is certainly a bug, though.


-k



reply via email to

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