Page 1 of 1

Why is ⎕THIS in a shared method not deterministic

Posted: Sun Oct 25, 2020 11:55 am
by Manuel Kassens
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.

Re: Why is ⎕THIS in a shared method not deterministic

Posted: Mon Oct 26, 2020 12:34 pm
by Vince|Dyalog
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