Sharp APL 
Author Message
 Sharp APL

Does anyone know of a discussion in which  Sharp's implementation of
nested arrays (called "boxed" arrays, I think) is compared to
the implementations of IBM (APL2) or STSC (APL*PLUS II)?

Thanks for any help!
Phil Viton

Sun, 19 Mar 1995 03:24:50 GMT  
 Sharp APL


>Does anyone know of a discussion in which  Sharp's implementation of
>nested arrays (called "boxed" arrays, I think) is compared to
>the implementations of IBM (APL2) or STSC (APL*PLUS II)?

Good topic for religious jihad, this.

Thumbnail sketch:

Both systems take ANY argument array and produce a scalar result
from the "enclose" or "box" functions. Both systems have "disclose"
or "open" functions which, given the result of enclose/box, produce
the original array.

For 99% of applications, the above works fine, and there's no big
deal difference from one to the other.

A niggling difference is that given a SIMPLE SCALAR (such as a
single character or number), APL2/STSC enclose is nilpotent. That
is, enclose 'x' is 'x'. However, enclose 'xx' is NOT 'xx' (enclose/box
always returns a scalar), AND enclose enclose 'xx' is NOT the same
as enclose 'xx'.

SHARP APL and SAX, VOS3 APL (Hitachi), Fujitsu APL, Siemens and Philips APL
systems, all make box produce a scalar which ALWAYS differs from the

The difference in implementations is that APL2/STSC FORCE a system to
support heterogeneous arrays, whereas SHARP APL permits it, but doesn't
require it. Also, SHARP APL permits you to encode information in the
depth of an array (how many times you applied box to it), whereas
APL2 loses information here.

Another way to view it is in set theory: SHARP APL contains all the
arrays in APL2, as well as as infinite set of arrays which are NOT
in APL2: The set of scalars boxed to an arbitrary depth.

That sums up the differences between the systems as far as enclose/box
is concerned.


APL2 has decided that The Wave Of The Future is enclosed arrays, and
extended MANY operators/adverbs in a way that both limits the
extensions of non-enclosed arrays, and forces the introduction of
enclosed arrays in places where they are in fact undesirable.

For example, reduction on a matrix is not defined! Reduction on a
vector is allowed, and defined in terms of a dual with disclose
composed with the reduction verb. If you want to apply the verb
to a non-vector argument, you have to dink around with the data,
rather than the operator expression. This results in convoluted code,
as well as (in an interpreter) more data sloshing (read this as:
slower applications) than you'd have otherwise.

Reductions on higher rank arrays than vector is performed by
laminating the results from reduction on vectors.

In SHARP APL, reduction consists of merely slicing the array along
the leading axis, sticking the reduction verb between the resulting
subarrays, and evaluating THAT "expression". Simple, and easy to
teach and use.


Snake Island Research Inc  (416) 368-6944   FAX: (416) 360-4694
18 Fifth Street, Ward's Island
Toronto, Ontario M5J 2B9

Mon, 20 Mar 1995 12:36:35 GMT  
 [ 2 post ] 

 Relevant Pages 

1. APL FAQ - correction re Sharp APL

2. Sharp APL (Was: questions on early APL

3. Sharp APL vs IBM APL ??????

4. Announcement: Version 4.03 of SHARP APL for UNIX

5. Sharp APL/PC reference binders

6. Product announcement - SHARP APL/UNIX 4.02


8. Sharp APL (really SAPL and APL2 arrays)


10. Experiments with I.P. SHARP APL/PC

11. Sharp APL for Linux and RedHat 9.0

12. Sharp APL for Linux 6.1


Powered by phpBB® Forum Software