Converting Dyalog APL Multiple Assignments to APL*PLUS 
Author Message
 Converting Dyalog APL Multiple Assignments to APL*PLUS

Quote:

>I have a couple of small functions written in Dyalog APL that I would
>like to play with in APL*PLUS II/386.  Many of the functions use what
>appears to be a multiple assignment statement:

>Var1 var2 var3 <- X  

>where X is a 3 element vector, typically the right argument to the
        ...
>This is all very tidy, but APL*PLUS doesn't work this way, at least

This is called "strand notation assignment" and is described on page 1-10
of the APL*PLUS II/386 version 5 ref manual. IBM APL2 calls it
"vector specification".

The quick repair for your problem is to add parens around the target
variable list:
        (Var1 var2 var3) <- X

In the early 1980's both IBM and STSC were in a kind of race to develop a
commercial nested array APL system. The dialects that resulted had several
accidental differences that have subsequently caused portability problems.
Dyalog APL is based on the early STSC system. Several years ago, to improve
compatibility with IBM's APL2, STSC changed the APL*PLUS II(and now III)
systems to require the parenthesis. If you have a great deal of older code,
you may wish to change the interpreter's "EVOLUTION LEVEL" setting.

Bill Rutiser
Manugistics, Inc.



Tue, 26 Aug 1997 02:28:36 GMT  
 Converting Dyalog APL Multiple Assignments to APL*PLUS
For Dyalog's:
   Var1 var2 var3 <- X  
Try in APL+2:
   (Var1 Var2 Var3) <- X
That's the way it works in IBM APL2 (and it is now permitted in Dyalog
APL/W 7.1 too).


Tue, 26 Aug 1997 07:47:59 GMT  
 Converting Dyalog APL Multiple Assignments to APL*PLUS
I have a couple of small functions written in Dyalog APL that I would
like to play with in APL*PLUS II/386.  Many of the functions use what
appears to be a multiple assignment statement:

Var1 var2 var3 <- X  

where X is a 3 element vector, typically the right argument to the
funtion

This is all very tidy, but APL*PLUS doesn't work this way, at least
the quick example I tried crashed, and there is no mention of this
capability in the ref. manual.

This is actually more of 'style' question than a programming problem.
What I usually do is provide a table in the comment section explaining
what each element of X is, and then just use X[i] in my code.  This is
compact, but negates the advantage of meaningful variable names.  The
other approach is just to 'manually' assign the elements of X to
full-blown variable names:

Var1 <- X[1] & Var2 <- X[2] & etc.

which seems a bit long winded.

I'd still want to include a table with a description of each variable
at the top of the function for user convenience.  Cribbing an idea from
Manugistics, I have an EXPLAIN function that extracts all of the
comments from the top of a function to help people remember the syntax
and operation.

Does anyone out ther have any tidy idioms for this sort of assignment
in APL*PLUS, or is there a trick to getting this to work the way Dyalog
does?  I'm also always interested in stylistic issues for vector
input like this that might make functions easier to read, maintain, and
use.

Doug White
MIT Lincoln Laboratory



Mon, 25 Aug 1997 22:20:48 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Dyalog APL vs APL*PLUS UNX

2. APL*PLUS III vs Dyalog APL/W

3. Trying to hire APL and DYALOG APL for Dallas

4. Freeware Dyalog APL WSS for OO/APL and software management

5. Porting APL*PLUS/PC to APL.68000

6. Porting Mainframe APL to APL*PLUS/PC

7. Translating COMPLEX.AWS from STSC APL-PLUS to generic APL

8. XP and APL font for APL-PLUS II?

9. Paradox and APL*PLUS II (Or APL+WIN) and Memo Fields

10. US-SFL APL/2, APL*Plus Analyst/Developer

11. US-SFL APL/2, APL Plus Analyst/Developer

12. VS APL and APL*PLUS III

 

 
Powered by phpBB® Forum Software