• ,[''] seems not to workl in NARS2000

    From Brian McGuinness@21:1/5 to All on Sun Nov 8 14:19:36 2020
    In Gnu APL2 I can do

    ,[''] ⍳4
    1
    2
    3
    4
    ,[⍳0] ⍳4
    1
    2
    3
    4

    But In NARS2000 I get

    ,[''] ⍳4
    1
    2
    3
    4
    ,[⍳0] ⍳4
    1
    2
    3
    4
    ,[''] ⍳4
    1
    2
    3
    4
    ,[⍳0] ⍳4
    1
    2
    3
    4
    ,[''] ⍳4
    1
    2
    3
    4
    ,[⍳0] ⍳4
    1
    2
    3
    4

    I always thought that '' and ⍳0 were considered equivalent unless you applied take to them, e.g. you could catenate either characters or numbers to either one.

    I generally dislike APL2 heterogeneous arrays -- J / Sharp APL homgeneous arrays with boxes seem much cleaner -- but APL2 ravel with axis is pretty cool.

    One other difference between the two interpreters is that replicate with negative numbers (to insert filler sort of like expand) works in GNU APL2 but not in NARS2000:

    GNU APL2:

    3 0 ¯1 2 4 / ⍳4
    1 1 1 0 3 3 4 4 4 4

    NARS2000:

    3 0 ¯1 2 4 / ⍳4
    LENGTH ERROR
    3 0 ¯1 2 4 / ⍳4

    3 0 ¯2 1 / ⍳ 4
    DOMAIN ERROR
    3 0 ¯2 1 / ⍳ 4


    --- Brian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)