Hi Mike,

this is a GNU APL feature. Instead of leaving ⎕-variables undefined
and raising the according error when referenced, GNU APL sets them
to their default values when they are being localized.

As a consequence, most ⎕-variables are always defined, which, in turn
makes the APL implementation much simpler because you save all tests
if this or that ⎕-variable is defined.

/// Jürgen


On 08/20/2015 04:41 AM, Mike Duvos wrote:
       A∘.=A←100-⎕CT×⍳10

1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1

[10 items, all tolerantly equal]

      ∇BLAH;⎕CT
[1]   A∘.=A
[2]   ∇
 

      BLAH
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1

[ ⎕CT has been localized,and not assigned a value.This should produce ⎕CT ERROR.  What on earth is it using for
⎕CT inside the function?]



Reply via email to