Sharp APL Syntax Question

Everything not about current APL2000 products.

Sharp APL Syntax Question

Postby aplus » May 1st, 2018, 10:53 am

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?
aplus
 
Posts: 164
Joined: April 16th, 2007, 2:21 pm
Location: Allentown, PA

Re: Sharp APL Syntax Question

Postby Davin Church » May 1st, 2018, 12:06 pm

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
Davin Church
 
Posts: 507
Joined: February 24th, 2007, 1:46 am


Return to Off-Topic

Who is online

Users browsing this forum: No registered users and 1 guest