Page 1 of 1

Sharp APL Syntax Question

PostPosted: May 1st, 2018, 10:53 am
by aplus
About 20 years ago I used Sharp APL at Morgan Stanley. Currently using Dyalog and APL2000 in some consulting capacities.

I seem to recall that in Sharp APL you could execute the following:

('CAT' 'LION' 'TIGER')[(1 2) (2 3) (3 2 1)]

and get:

CAT LION LION TIGER TIGER LION CAT
a 3 element vector of vectors of shapes 2, 2 and 3

I can't do that in the current version of Dyalog or in my antiquated version of APL2000.

Am I dreaming or was that syntax really possible in Sharp?

Re: Sharp APL Syntax Question

PostPosted: May 1st, 2018, 12:06 pm
by Davin Church
I don't recall if that was called Reach, Scatter, or Choose indexing (at least from old NARS' definition), and I'm not precisely sure that that was the result you get with that structure. (There were lots of ways to organize "nested" indexing and I never got to play with it much.) But you can do what you're asking for with the syntax:
Code: Select all
      (⊂¨(1 2) (2 3) (3 2 1))⌷¨⊂'CAT' 'LION' 'TIGER'
  CAT LION   LION TIGER   TIGER LION CAT