• Replicate: NARS2000 vs GNU APL

    From Brian McGuinness@b.mcguinness747@gmail.com to comp.lang.apl on Mon Aug 30 13:24:54 2021
    From Newsgroup: comp.lang.apl

    NARS2000 requires the left and right arguments to have the same length:
    1 ->2 3 2 / 10 20 30
    LENGTH ERROR
    1 ->2 3 2 / 10 20 30
    reo
    ->2 3 2 / 10 20 30
    0 0 20 20 20 30 30
    GNU APL requires the number of nonnegative values in the left argument to match the number of items in the right argument:
    1 ->2 3 2 / 10 20 30
    10 0 0 20 20 20 30 30
    ->2 3 2 / 10 20 30
    LENGTH ERROR
    ->2 3 2/10 20 30
    ^ ^
    The GNU APL approach seems to agree with the description of replicate in the IBM APL2 manual.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From J. Clarke@jclarke.873638@gmail.com to comp.lang.apl on Mon Aug 30 17:44:22 2021
    From Newsgroup: comp.lang.apl

    On Mon, 30 Aug 2021 13:24:54 -0700 (PDT), Brian McGuinness <b.mcguinness747@gmail.com> wrote:

    NARS2000 requires the left and right arguments to have the same length:

    1 ->2 3 2 / 10 20 30
    LENGTH ERROR
    1 ->2 3 2 / 10 20 30
    ?
    ->2 3 2 / 10 20 30
    0 0 20 20 20 30 30


    GNU APL requires the number of nonnegative values in the left argument to match the number of items in the right argument:

    1 ->2 3 2 / 10 20 30
    10 0 0 20 20 20 30 30
    ->2 3 2 / 10 20 30
    LENGTH ERROR
    ->2 3 2/10 20 30
    ^ ^


    The GNU APL approach seems to agree with the description of replicate in the IBM APL2 manual.

    The following trace is from Dyalog:
    1 ->2 3 2 / 10 20 30
    LENGTH ERROR
    1 ->2 3 2/10 20 30
    ^

    I believe emulating Dyalog is a better choice than emulating APL2,
    which seems to be starting down the path to abandonware.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From =?UTF-8?Q?Ad=C3=A1m_Brudzewsky?=@a.brudz@gmail.com to comp.lang.apl on Tue Aug 31 06:36:44 2021
    From Newsgroup: comp.lang.apl

    After Dyalog adopted the definition of Replicate used by NARS, APL2 developed another definition, which differs in its handling of negative numbers in the left argument. In APL2, a negative number does not "consume" an element of the right argument, so that instead of (reori|)=reori|, we have (+/0renri|)=reori|. Developers of XAPL noticed that both extensions can be supported simultaneously: if the left argument has any negative numbers, the interpreter can tell which one the programmer meant by checking whether the right argument's length is equal to the left (NARS-style) or shorter (APL2-style). In fact, APLX already does this:
    ```
    APLX for Windows
    Copyright (C) 2001-2010 MicroAPL Ltd
    WS Size = 20.0MB, Version = 5.1.0
    CLEAR WS
    1 ->2 3 2 / 10 20 30
    10 0 0 20 20 20 30 30
    ->2 3 2 / 10 20 30
    0 0 20 20 20 30 30
    ```
    On Monday, August 30, 2021 at 10:44:25 PM UTC+1, J. Clarke wrote:
    On Mon, 30 Aug 2021 13:24:54 -0700 (PDT), Brian McGuinness <b.mcgui...@gmail.com> wrote:

    NARS2000 requires the left and right arguments to have the same length:

    1 ->2 3 2 / 10 20 30
    LENGTH ERROR
    1 ->2 3 2 / 10 20 30
    ?
    2 3 2 / 10 20 30
    0 0 20 20 20 30 30


    GNU APL requires the number of nonnegative values in the left argument to match the number of items in the right argument:

    1 ->2 3 2 / 10 20 30
    10 0 0 20 20 20 30 30
    2 3 2 / 10 20 30
    LENGTH ERROR
    2 3 2/10 20 30
    ^ ^


    The GNU APL approach seems to agree with the description of replicate in the IBM APL2 manual.
    The following trace is from Dyalog:
    1 ->2 3 2 / 10 20 30
    LENGTH ERROR
    1 ->2 3 2/10 20 30
    ^

    I believe emulating Dyalog is a better choice than emulating APL2,
    which seems to be starting down the path to abandonware.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From joseph turco@italian.pepe.32@gmail.com to comp.lang.apl on Wed Oct 6 11:14:26 2021
    From Newsgroup: comp.lang.apl

    On Monday, August 30, 2021 at 4:24:55 PM UTC-4, b.mcgui...@gmail.com wrote:
    NARS2000 requires the left and right arguments to have the same length:

    1 ->2 3 2 / 10 20 30
    LENGTH ERROR
    1 ->2 3 2 / 10 20 30
    reo
    2 3 2 / 10 20 30
    0 0 20 20 20 30 30


    GNU APL requires the number of nonnegative values in the left argument to match the number of items in the right argument:

    1 ->2 3 2 / 10 20 30
    10 0 0 20 20 20 30 30
    2 3 2 / 10 20 30
    LENGTH ERROR
    2 3 2/10 20 30
    ^ ^


    The GNU APL approach seems to agree with the description of replicate in the IBM APL2 manual.
    sorry to hijack this thread, but are you learning GNU APL from the IBM manual? I cant find anything like 'Mastering dyalog APL' for using GNU APL.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Brian McGuinness@b.mcguinness747@gmail.com to comp.lang.apl on Sun Oct 24 18:54:32 2021
    From Newsgroup: comp.lang.apl

    I am experimenting with the interpreters and comparing the results with a copy of the IBM APL2 manual.

    --- Brian McGuinness
    --- Synchronet 3.21d-Linux NewsLink 1.2