depth of instances

General APL language issues

depth of instances

Postby giangiquario on Tue May 11, 2010 8:57 am

let myinstance be a class 9.2 object.
Then
≡myinstance
0
And
≡myinstance myinstance
1

≡ 0⍴myinstance
NONCE ERROR

Can you explain the reason for NONCE ERROR? Thank you.
User avatar
giangiquario
 
Posts: 46
Joined: Thu Nov 26, 2009 8:55 am
Location: Milano, Italia

Re: depth of instances

Postby Phil Last on Tue May 11, 2010 10:00 pm

You can create an empty array of instances (namespaces) but any operation that has to enquire into the contents fails because there aren't any and there isn't a prototype.

I guess depth is not contained in an array header.

I believe if you create a niladic constructor Dyalog will create a prototype for you and tell you the depth of an empty array formed from that.

But I haven't tried it.
User avatar
Phil Last
 
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: depth of instances

Postby giangiquario on Wed May 12, 2010 1:15 pm

The behaviour of references_to_namespaces and instances_of_classes is different.
Suppose that nspa is a reference to a namespace and inst is a instance of a class.

Let's begin with namespaces
Code: Select all
      ≡nspa
0
      ≡nspa nspa
1
      0⍴nspa  ⍝ is valid

      ⊃0⍴nspa
NONCE ERROR 
      ⊃0⍴nspa
     ∧       

      ≡0⍴nspa
NONCE ERROR
       ≡0⍴nspa
     ∧       




Now consider an instances

Code: Select all

      ≡inst
0
      ≡inst inst
1
      0⍴inst  ⍝ is valid

      ⊃0⍴inst  ⍝ is valid! there is a prototype
#.[ResourceHolder]
      ≡0⍴inst 
NONCE ERROR                                   
      ≡0⍴inst 
     ∧                                         




I do not understand why inst has a prototype but has not any depth.
User avatar
giangiquario
 
Posts: 46
Joined: Thu Nov 26, 2009 8:55 am
Location: Milano, Italia

Re: depth of instances

Postby Phil Last on Wed May 12, 2010 1:38 pm

In which case I guess it really is a NONCE ERROR. I.e. "for the nonce", "for now", "until we get round to it"!
User avatar
Phil Last
 
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: depth of instances

Postby JohnS|Dyalog on Thu May 13, 2010 7:27 am

I just discussed this with Morten; we agree that it is now time to eliminate this NONCE error.
JohnS|Dyalog
 


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest