I met a condition where an instance had no parents.
In fact - inside a Destructor function -
⎕this
returned
.[myClass]
and
⎕this.##
returned
DOMAIN ERROR
Is it a possible state of an instance or did I do something wrong?
Instance with no parent
- giangiquario
- Posts: 46
- Joined: Thu Nov 26, 2009 8:55 am
- Location: Milano, Italia
- Morten|Dyalog
- Posts: 460
- Joined: Tue Sep 09, 2008 3:52 pm
Re: Instance with no parent
I can't think of a way in which this could happen - would be very interested to see code that could reproduce it!
- giangiquario
- Posts: 46
- Joined: Thu Nov 26, 2009 8:55 am
- Location: Milano, Italia
Re: Instance with no parent
I squeezed the class that created that situation and prepared a simple .DWS
The workspace (dyalog 11.1) is attached.
Instructions:
(⎕NEW morten.first).Play
In form “first class” press button “Input data”.
In form “aaaaaaaaa” press button “Quit”
In form “fist class” press button “Quit”
DOMAIN ERROR
kill[3] parentName←⍕⎕THIS.##
∧
PS. I'm sorry. I tried to upload the DWS but I cannot find it in this post.
The workspace (dyalog 11.1) is attached.
Instructions:
(⎕NEW morten.first).Play
In form “first class” press button “Input data”.
In form “aaaaaaaaa” press button “Quit”
In form “fist class” press button “Quit”
DOMAIN ERROR
kill[3] parentName←⍕⎕THIS.##
∧
PS. I'm sorry. I tried to upload the DWS but I cannot find it in this post.
- Morten|Dyalog
- Posts: 460
- Joined: Tue Sep 09, 2008 3:52 pm
Re: Instance with no parent
The forums have a pretty restrictive policy about the document types that can be uploaded. I have added both .DWS and .DYALOG to the list, and it now seems possible to attach workspaces. Yours is attached: We will investigate your problem, it does seem a little mysterious. Thanks for the report and the repro!
- Attachments
-
[The extension dws has been deactivated and can no longer be displayed.]
-
- Posts: 66
- Joined: Mon Apr 04, 2011 3:16 pm
Re: Instance with no parent
Is there a difference between using ##.[]THIS and []THIS.## ? I have been using the former im my code, but perhaps the latter more correct.
- JohnD|Dyalog
- Posts: 74
- Joined: Wed Oct 01, 2008 9:35 am
Re: Instance with no parent
Hi Erik,
##.⎕this and ⎕this.## should be equivalent. It's entirely your preference which you choose to use.
Best Regards,
John Daintree
##.⎕this and ⎕this.## should be equivalent. It's entirely your preference which you choose to use.
Best Regards,
John Daintree