Why is ⎕THIS in a shared method not deterministic
2 posts
• Page 1 of 1
Why is ⎕THIS in a shared method not deterministic
When i call a public shared method from outside, ⎕THIS is a reference to the class.
If I call this shared method from an instance method of the same class, ⎕THIS is a reference to the instance.
As a workaround I use in my static method (↑⊃⊃⎕CLASS ⎕THIS) instead simply ⎕THIS.
If I call this shared method from an instance method of the same class, ⎕THIS is a reference to the instance.
As a workaround I use in my static method (↑⊃⊃⎕CLASS ⎕THIS) instead simply ⎕THIS.
- Manuel Kassens
- Posts: 2
- Joined: Wed Apr 22, 2020 2:17 pm
Re: Why is ⎕THIS in a shared method not deterministic
Hi Manuel,
I think this is working as designed--that when you are in an instance method, the current namespace that ⎕THIS will refer to is that instance.
Regards,
Vince
I think this is working as designed--that when you are in an instance method, the current namespace that ⎕THIS will refer to is that instance.
Regards,
Vince
- Vince|Dyalog
- Posts: 430
- Joined: Wed Oct 01, 2008 9:39 am
2 posts
• Page 1 of 1
Return to Object Oriented Programming
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group