I have probably forgotten something, but...
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 !
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 !
4 posts
• Page 1 of 1
I have probably forgotten something, but...
Take
r←'Resources'#.⎕NS''
Resources.x←1
r.y←1
SYNTAX ERROR
r.y←1
∧
r
#.Resources
Just wondering why I get the syntax error
r←'Resources'#.⎕NS''
Resources.x←1
r.y←1
SYNTAX ERROR
r.y←1
∧
r
#.Resources
Just wondering why I get the syntax error
- crishog
- Posts: 61
- Joined: Mon Jan 25, 2010 9:52 am
Re: I have probably forgotten something, but...
You intuitively assumed that
assigns a reference to "r", but it's rather a name.
Instead
does the trick.
Or you do it this way:
r←'Resources'#.⎕NS''
assigns a reference to "r", but it's rather a name.
Instead
r←⍎'Resources'#.⎕NS''
does the trick.
Or you do it this way:
Resources←⎕ns''
Resources.x←1
Resources.y←1
-
kai - Posts: 137
- Joined: Thu Jun 18, 2009 5:10 pm
- Location: Hillesheim / Germany
Re: I have probably forgotten something, but...
Whereas monadic quad NS does return the anonymous namespace. The result is not as consistent as I thought
I meant to type
Resources <- []NS ''
Sorry no APL keyboard at the moment
I meant to type
Resources <- []NS ''
Sorry no APL keyboard at the moment
- crishog
- Posts: 61
- Joined: Mon Jan 25, 2010 9:52 am
Re: I have probably forgotten something, but...
Yes, it's not consistent, but there's a reason why:
1. When ⎕NS was introduced, references weren't yet available in Dyalog.
2. With anonymous namespaces on the other hand there is no name, so it can only return a reference.
1. When ⎕NS was introduced, references weren't yet available in Dyalog.
2. With anonymous namespaces on the other hand there is no name, so it can only return a reference.
-
kai - Posts: 137
- Joined: Thu Jun 18, 2009 5:10 pm
- Location: Hillesheim / Germany
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