bug-apl
[Top][All Lists]
Advanced

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

Re: ¨ (each) on defined function on array of empty arrays


From: Dr . Jürgen Sauermann
Subject: Re: ¨ (each) on defined function on array of empty arrays
Date: Sun, 31 May 2020 16:13:28 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Hi again,

fixed in SVN 1289.

Thanks,
Jürgen


On 5/31/20 12:48 PM, Dr. Jürgen Sauermann wrote:
Hi Ben,

see below.

Jürgen


On 5/30/20 6:46 PM, Ben Harris wrote:
[ Not sure if you deliberately left bug-apl off the recipient list:
feel free to forward to the list if you want. ]

No. I probably just pushed reply instead of reply-to-all. I normally
want all communication
to be as transparent as possible, but sometimes I fail to  achieve that.
On Sat, 30 May 2020, Dr. Jürgen Sauermann wrote:

not sure if it is an error. I suspect that the reason for the
difference you see is caused by the fact that the primitive ≡ and
your defined function 'depth' have different fill functions. The fill
function is a function applied to the empty arguments. The fill
function for ≡ is ≡ while the fill function for any defined function
(including depth) is { ⍵ } (or Z←B as IBM phrases it).
I've looked briefly at the manual before realising that fill functions
aren't relevant here.  The fill function is necessary when the right
argument (R) to ¨ is empty, but here R is not empty, it's an array
with two elements.  Each of those elements is empty, but R itself is not.

So I think "each" should just pass each empty array to ≡ or depth as
appropriate and it's only those functions that should pay attention to
the emptiness of the arrays.  The description of the calling sequence
for a defined function doesn't say anything special about empty
arrays, so the empty arrays should just be passed on to ≡,so the two
results should be the same.

I see. I will have another look at it, I did some tests with IBM APL2
after reading your first mail,
but everything related to empty values (or non-empty values containing
empty values) is
difficult to distinguish.
Fill functions would matter if I evaluated ≡¨a or depth¨a, and indeed
those differ (and I think give the correct results).





reply via email to

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