Hi,

the IBM APL2 language reference says (page 111):

If R is a simple scalar, ⊂R is R. If R is not a simple scalar, the depth of R is 1+ ≡R.

And the ISO standard says the same (page 169):

Z ← ⊂B
 Note: If B is a simple-scalar, Z is B.

Therefore I believe Elias' statement

My understanding was that (⊂⊂x)≡⊂x for all x?

is correct as far as ISO, IBM APL2, and GNU APL are concerned.

/// Jürgen


On 03/03/2016 10:21 AM, Jay Foad wrote:
On 3 March 2016 at 08:12, Elias Mårtenson <loke...@gmail.com> wrote:
What is the purpose of the double-enclose ⊂⊂⍬ ?

My understanding was that (⊂⊂x)≡⊂x for all x?
No! ⊂ is a no-op on simple scalars like 42, but not on enclosures like
⊂⍬. You can enclose most arrays (i.e. anything except simple scalars)
as many times as you like, and they keep getting deeper and deeper.

Hmm, now I see that GNU APL seems to be broken. In APL2 and Dyalog and
NARS2000 I get:

      ≡⊂⊂⊂⊂⊂⊂⊂⊂⊂'elias'
10

But in GNU APL:

      ≡⊂⊂⊂⊂⊂⊂⊂⊂⊂'elias'
2

Jay.


Reply via email to