🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.apl
Article #198

Nested arrays

#198
From: KW Heuer
Date: Mon, 19 May 1986 14:13
30 lines
2182 bytes
In article <371@water.UUCP> water!ljdickey (Lee Dickey) writes:
>GCOS APL allows things of the sort  list  <-  (a;b;c)
>[In IBM's APL2] one uses "strand notation" ...  list2  <-  a b c

Neither of these notations allows you to write a zero- or one-element list.
(I know, you can't directly write a zero- or one-element vector either*.)
You can get around that by changing the notation to "{a;b;c}".  But this
still seems inelegant.

>[Sharp APL has] new primitives called enclose and disclose.  The result of
>enclose is always a scalar.  Disclose is a left inverse of enclose.

I find this one easiest to understand.  Enclose always returns a scalar of
(new) type "tree"; arrays are still homogeneous but the scalars in a tree
array may disclose to any object; the "standard scalar" of type tree (the
filler value for overtake or expand, corresponding to numeric zero and
character blank) is the enclosure of an empty tree.  This is the "grounded"
tree model.

There's also a "floating" tree model, whose main distinction is that for any
scalar foo, foo equals enclose foo.  (In the grounded model, "0" "<0" "<<0"
(monadic "<" is enclose) are all distinct objects, and ">0" gives a domain
error.)  I think this causes unnecessary complications -- you have to allow
true heterogeneous arrays, and I think the "first" element is distinguished.

Karl W. Z. Heuer (ihnp4!bentley!kwh), The Walking Lint
*I lied.  '' denotes a zero-element character vector.  What you can't write
is a numeric vector of length zero or one, or a character vector of length
one, as a constant.  Or any array of higher rank.  Are 2D lists permitted in
GCOS APL or APL2?  Does "2 2 rho {a;b;c;d}" work?
Technical Details
Message-ID: <834@bentley.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!seismo!lll-crg!topaz!bentley!kwh
References: <371@water.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!seismo!lll-crg!topaz!bentley!kwh
From: kwh@bentley.UUCP (KW Heuer)
Newsgroups: net.lang.apl
Subject: Nested arrays
Message-ID: <834@bentley.UUCP>
Date: Mon, 19-May-86 10:13:47 EDT
Article-I.D.: bentley.834
Posted: Mon May 19 10:13:47 1986
Date-Received: Tue, 20-May-86 07:46:12 EDT
References: <371@water.UUCP>
Organization: AT&T Bell Laboratories, Liberty Corner
Lines: 30