[Top][All Lists]

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

Re: Selective Assignment - first each

From: David Tran
Subject: Re: Selective Assignment - first each
Date: Fri, 27 Dec 2019 19:39:22 -0500

Thank you Jürgen.


On Fri, Dec 27, 2019 at 2:11 PM Dr. Jürgen Sauermann <mail@jürgen-sauermann.de> wrote:
Hi again,

I have done a rework of the EACH operator so that your example
(and similar ones) should work now. SVN 1213.

However, please keep the following in mind: Since
selective specification is not a standard feature (and
quite complicated compared to other functions, there is
still a high probability that some cases were not caught
properly. Your example, for instance, survived for almost
a decade before you discovered it.

For that reason I would recommend that everybody who is
writing business critical applications in GNU APL should
use not-so-standard features only if the benefit that they
provide is significant and make sure that the code is being
tested thoroughly.

Best Regards,

On 12/27/19 12:22 PM, Dr. Jürgen Sauermann wrote:
Hi David,

your example touches a somewhat dubious area. Its name is
Selective assignment (basically using functions left of ←where
the functions compute what is being assigned),

Selective assignment is defined in APL2 but not in the APL2 ISO
standard (APL2 is named extended APL there).

And even in APL2 there are restrictions (as the IBM APL2 language
reference says: "The information in this section is based on the APL2 language
Deviations exist on some platforms and are documented in the
separate user's

GNU APL supports most, but not all, selective specifications that APL2 does.
The only not supported case that I am aware of is monadic and dyadic
EACH (¨). The reason is that in GNU APL EACH is a macro (a defined function
that is only used internally). The syntax error probably comes because in APL2
selective specification is only allowed for certain primitive functions left of ← but
not for defined functions.

I will look into this to see if it is feasible to fix it. The primary reason why macros
were introduced in GNU APL was primitive operators with defined functions.
Here we only have a primitive operator with primitive functions, which makes
things a lot simpler.

Best regards,

On 12/27/19 5:37 AM, David Tran wrote:

Currently study APL2, and found an example that won't work on Gnu APL:

v ← 12(13(14 15))(16 17)
(↑¨v) ← 2 3 6

On the book, above statement will change v into 2 (3 (14 15)) (6 17);  however Gnu APL returns Syntax Error.

Is such "first each assignment" not APL2 standard specification, or it is just Gnu APL is not support yet?


reply via email to

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