Documented? ⎕NC puts # and ⎕SE refs in class 9.2.
4 posts
• Page 1 of 1
Documented? ⎕NC puts # and ⎕SE refs in class 9.2.
What would lead one to expect jill and sam in the snippet below to have (extended) name class (⎕NC) 9.2? The documentation suggests that name class 9.2 is for class instances, GUI objects, .NET objects, etc. Should the documentation include refs to ⎕SE and # here (or under ⎕NC 9.1), or is this an uncaught infelicity? It would be very convenient for testing purposes for this to be codified (since it allows an easy way to validate ⎕SE or # passed to a function as arguments).
- Code: Select all
)clear
clear ws
)ns john ⍝ john: just an ordinary namespace
#.john
jack←john ⍝ jack refs john
jill←# ⍝ jill refs #
sam←⎕SE ⍝ sam refs ⎕SE
⎕NC 'john' 'jack' '#' 'jill' 'sam'
9.1 9.1 ¯1 9.2 9.2
- petermsiegel
- Posts: 143
- Joined: Thu Nov 11, 2010 11:04 pm
Re: Documented? ⎕NC puts # and ⎕SE refs in class 9.2.
Hi Peter,
We count # and ⎕SE as objects like a form, for example. # and ⎕SE have methods and properties. In your example, jill and sam are very much like instances which are 9.2.
⎕se.⎕wg 'Type'
Session
#.⎕wg 'Type'
Root
'f' ⎕wc 'form'
fref←f
f.⎕wg 'Type'
Form
42 ⎕atx 'fref'
9.2
⎕nc ⊂'fref'
9.2
I will log a docs issue to make clear that references to # and ⎕SE are also 9.2.
Regards,
Vince
We count # and ⎕SE as objects like a form, for example. # and ⎕SE have methods and properties. In your example, jill and sam are very much like instances which are 9.2.
⎕se.⎕wg 'Type'
Session
#.⎕wg 'Type'
Root
'f' ⎕wc 'form'
fref←f
f.⎕wg 'Type'
Form
42 ⎕atx 'fref'
9.2
⎕nc ⊂'fref'
9.2
I will log a docs issue to make clear that references to # and ⎕SE are also 9.2.
Regards,
Vince
- Vince|Dyalog
- Posts: 413
- Joined: Wed Oct 01, 2008 9:39 am
Re: Documented? ⎕NC puts # and ⎕SE refs in class 9.2.
Thanks. It makes sense. # and ⎕SE are odd, "polymorphic", beasts...
- petermsiegel
- Posts: 143
- Joined: Thu Nov 11, 2010 11:04 pm
Re: Documented? ⎕NC puts # and ⎕SE refs in class 9.2.
Vince|Dyalog wrote:jill and sam are very much like instances which are 9.2.
I would go one step further and say that jill and sam are references to instances. Internally, # and ⎕SE are instances of the root and the session class (there can currently only be one of each). Both of these objects can have children, methods, and support events.
The Dyalog documentation is not clear enough about ⎕NC: This function classifies user defined names. We will be revising the documentation to be clearer about this. The two codes 0 and ¯1 should be understood as follows:
- 0: The name is free or "available" for use
- ¯1: The name cannot be used to name anything user-defined (#, ⎕SE, ⎕IO, 1.5, ...)
-
Morten|Dyalog - Posts: 453
- Joined: Tue Sep 09, 2008 3:52 pm
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group