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
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 !
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
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
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.