[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Support for 'where' primitive '⍸' ?
From: |
Jay Foad |
Subject: |
Re: Support for 'where' primitive '⍸' ? |
Date: |
Fri, 27 Nov 2020 13:48:22 +0000 |
Dyalog's documentation for Where (monadic ⍸) is here:
http://help.dyalog.com/18.0/#Language/Primitive%20Functions/Where.htm
It was implemented long after Mastering Dyalog APL was written.
Re: monadic ⍳ with vector arguments, I believe Dyalog got this from
the original NARS: see https://aplwiki.com/wiki/NARS: "Additionally,
Index Generator was extended to allow a vector argument".
Jay.
On Fri, 27 Nov 2020 at 13:42, Dr. Jürgen Sauermann
<mail@jürgen-sauermann.de> wrote:
>
> Hi Russ,
>
> welcome to APL. And welcome to bug-apl@gnu.org. The latter is a moderated
> list, so please subscribe to
> it because otherwise each of your emails will require (manual) approval by
> myself.
>
> Back to your question, ⍸ is definitely not a standard APL primitive. My only
> source of information about Dyalog APL,
> the book with the title Mastering Dyalog APL - A Complete Introduction to
> Dyalog APL, seems not to mention it
> either.
>
> I am somewhat reluctant when it comes to introducing non-standard APL
> functions into GNU APL. In my
> opinion, which is certainly arguable, non-standard extensions of APL may lure
> APL programmers into
> writing non-standard APL programs, which in turen undermines and even
> contradicts the principles of
> free software.
>
> For a non-standard extension to make it into APL, the extension has to
> smoothly integrate into APL. One
> of the rare examples where this was the case was monadic ⍳ with vector
> arguments adopted from
> Dyalog APL. That extension was sort of filling a rather arbitrary gap in
> standard APL, making APL
> more consistent than it was before.
>
> Some other extension in Dyalog did not make it into GNU APL because IMHO the
> additional benefit that
> they provided was not worth the incompatibility that every non-standard
> extension unavoidably creates.
>
> I cannot judge to which kind of extensions ⍸ belongs since I do not know what
> it actually does. I will consider
> any opinions posted on bug-apl@gnu.org, though.
>
> Best Regards,
> Jürgen
>
>
>
> On 11/26/20 11:15 PM, Russtopia wrote:
>
> Hi, newbie to APL so my sincere apologies in advance if this is incorrect, an
> FAQ, or by design (intentionally not implemented).
>
> Dyalog APL appears to support monadic ⍸ (underscore-iota) primitive as a
> 'where' function, eg.
>
> b ← 0 0 1 1 0
> ⍸b
> 3 4
>
> ..whereas GNU APL considers the ⍸ as an invalid symbol (SYNTAX ERROR)
>
> Equivalent seems to be
> b / ⍳⍴ b
> 3 4
>
> .. just wondering if this is a Dyalog non-standard and if GNU APL plans to
> implement it.
>
> Thanks,
> -Russ
>
>