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 !

Where is this variable coming from

Postby jmosk on Wed Oct 18, 2017 4:51 pm

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

jmosk
 
Posts: 33
Joined: Thu Jul 18, 2013 5:15 am

Re: Where is this variable coming from

Postby Jay|Dyalog on Thu Oct 19, 2017 7:57 am

Does
Code: Select all
⎕NC 'layers'
or
Code: Select all
⎕NC ⊂'layers'
give any clues?
Jay|Dyalog
 
Posts: 16
Joined: Mon Aug 09, 2010 10:45 am

Re: Where is this variable coming from

Postby Geoff|Dyalog on Thu Oct 19, 2017 8:09 am

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.
Geoff|Dyalog
 
Posts: 43
Joined: Wed May 13, 2009 12:36 pm

Re: Where is this variable coming from

Postby jmosk on Fri Oct 27, 2017 11:20 am

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.
jmosk
 
Posts: 33
Joined: Thu Jul 18, 2013 5:15 am


Return to APL Chat

Who is online

Users browsing this forum: No registered users and 2 guests