[Top][All Lists]

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

Re: Selective Assignment - first each

From: Dr . Jürgen Sauermann
Subject: Re: Selective Assignment - first each
Date: Fri, 27 Dec 2019 12:22:46 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

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]