Page 1 of 1

Where is this variable coming from

Posted: Wed Oct 18, 2017 4:51 pm
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


Re: Where is this variable coming from

Posted: Thu Oct 19, 2017 7:57 am
by Jay|Dyalog
Does

Code: Select all

⎕NC 'layers'
or

Code: Select all

⎕NC ⊂'layers'
give any clues?

Re: Where is this variable coming from

Posted: Thu Oct 19, 2017 8:09 am
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.

Re: Where is this variable coming from

Posted: Fri Oct 27, 2017 11:20 am
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.