Where is this variable coming from

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !
Post Reply
User avatar
jmosk
Posts: 69
Joined: Thu Jul 18, 2013 5:15 am

Where is this variable coming from

Post by jmosk »

I have a certain workspace that I can load, where it shows there are no variables defined, yet when I put in the name of a particular variable, it is showing a value. I know the variable name I am using is not defined as a function [it does not appear on )fns]. And )vars displays nothing. Yet a value appears. Any idea why this does not appear under )vars? Why is the variable name 'layers' not appearing under )vars? And I cannot delete the variable name since the interpreter says it does not exist. So where might it appear to exist since it does generate a value. Of course this problem goes away if I clear the workspace.

Code: Select all


      )vars
      ]display layers
┌→┐
│3│
└~┘
      ⍴layers
1
      )vars
      )erase layers
not found layers
      layers
3

+←--------------------------------------------------------------→
+ Jay Moskowitz
+←--------------------------------------------------------------→
+ http://www.linkedin.com/in/jay-moskowitz-5745b83
+
Jay|Dyalog

Re: Where is this variable coming from

Post by Jay|Dyalog »

Does

Code: Select all

⎕NC 'layers'
or

Code: Select all

⎕NC ⊂'layers'
give any clues?
Geoff|Dyalog
Posts: 43
Joined: Wed May 13, 2009 12:36 pm

Re: Where is this variable coming from

Post by Geoff|Dyalog »

System commands like )fns, )vars, ... show the names as if there was no stack. If you do )sinl all will become clear.

⎕NL shows names that can be seen in the current state of the stack.

This behaviour difference was inherited from historical APLs.

If you want to go deeper then ⎕STATE will enable you to see the value of a name at any point in the stack.
User avatar
jmosk
Posts: 69
Joined: Thu Jul 18, 2013 5:15 am

Re: Where is this variable coming from

Post by jmosk »

Jay|Dyalog wrote:Does

Code: Select all

⎕NC 'layers'
or

Code: Select all

⎕NC ⊂'layers'
give any clues?


Yes I did find the variable was on the stack and could click on the variable name and see the value in the stack. Thank you for the explaination.
+←--------------------------------------------------------------→
+ Jay Moskowitz
+←--------------------------------------------------------------→
+ http://www.linkedin.com/in/jay-moskowitz-5745b83
+
Post Reply