bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Localizing ⎕CT


From: Mike Duvos
Subject: Re: [Bug-apl] Localizing ⎕CT
Date: Thu, 20 Aug 2015 07:20:40 -0700

Hi Elias,

The behavior seems to be that localized  ⎕ variables inherit the value they had in the outer context unless you change them.  If you do change them, they get their old value back when you exit the function in which they were localized.

As far as I can tell, you can't expunge them, so they are never undefined.

This differs a bit from APL2, but should interoperate with existing code.

Regards,

Mike


On Thu, Aug 20, 2015 at 3:37 AM, Elias Mårtenson <address@hidden> wrote:
⎕CT is never looked up as a normal variable. Internally it's using the value of Workspace::get_CT() (check the source file Workspace.hh).

Setting the value of the "variable" ⎕CT will simply change this value.

Regards,
Elias

On 20 August 2015 at 10:41, Mike Duvos <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]