[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: /⍨
From: |
hudson |
Subject: |
Re: /⍨ |
Date: |
Tue, 31 May 2022 21:08:01 -0300 (BRT) |
Hi Jürgen,
There are some APL implementations that accept the form /⍨ .
The GNU APL info manual had a section about the ambiguity of /⌿\⍀ , now
removed, it seems.
I collected some other issues I have with GNU APL (exceptions caused by user
errors and more).
See attachments. If you cannot replicate the exceptions, please tell me how to
try inspect them.
Thanks,
Hudson
----- Em 31 de Maio de 2022, em 17:02, Dr. Jürgen Sauermann
mail@jürgen-sauermann.de escreveu:
> Hi Hudson,
>
> I checked with IBM APL2.
>
> Unfortunately my IBM APL2 has no ⍨ (aka. duplicate) operator.
> But we can emulate it easily:
>
> DUP ←{ ⍵ ⍶ ⍵ }
> + DUP 1 2 3
> 2 4 6
> × DUP 1 2 3
> 1 4 9
>
> In GNU APL, DUP gives the same result as ⍨:
>
> /⍨1 2 3
> SYNTAX ERROR
> /⍨1 2 3
> ^^
>
> /DUP 1 2 3
> SYNTAX ERROR
> /DUP 1 2 3
> ^^
>
> However, in IBM APL2 I get the same (see attached screenshot),
>
> The problem seems to be caused by the ambiguity of / and friends (i.e. ⌿, \,
> and
> ⍀ ).
> You can work around this with a wrapper around /:
>
> REPL←{ ⍺ / ⍵ } ⍝ disambiguates / to mean replicate and not reduce
> 3 REPL 1 2 3
> 1 1 1 2 2 2 3 3 3
>
> REPL ⍨ 1 2 3
> 1 2 2 3 3 3
>
> 1 2 3 REPL 1 2 3 ⍝ same as REPL ⍨ 1 2 3
> 1 2 2 3 3 3
>
> Best Regards,
> Jürgen
>
> On 5/31/22 2:18 AM, [ mailto:hudson@hudsonlacerda.com |
> hudson@hudsonlacerda.com
> ] wrote:
>
>> Hi.
>
>> I get "SYNTAX ERROR" messages for /⍨ or ⌿⍨ :
>
>> /⍨⍳3
>> ⌿⍨⍳3
>
>> Regards,
> > Hudson
log
Description: Binary data
test.apl
Description: Binary data
- /⍨, hudson, 2022/05/30
- Re: /⍨, Dr . Jürgen Sauermann, 2022/05/31