On Sat, 26 Nov 2016, Eliot Miranda wrote:
Hi Levente,
On Nov 26, 2016, at 3:02 AM, Levente Uzonyi leves@caesar.elte.hu wrote:
On Sat, 26 Nov 2016, Clément Bera wrote:
If the send is to a non failing primitive call, there is no suspension
point either. So I don't think it would break programs.
When there's a send, one can override the method, so the guaratee of no suspension points is gone.
Right, but as the doctor says, "don't do that". For example, provided that the method is only overridden in exotic classes such as proxy classes, and is not overridden for nil and things like LinkedList, Semaphore and Process then it can still be used without fear of suspension points in the scheduler.
Okay. Let's see a real world example of #== being a message send. Let's say I have class Proxy which overrides #==. Let's say myProxy is an instance of Proxy for the value 0.
0 == myProxy "==> false, because 0 is the receiver, and the primitive is used." myProxy == 0 "==> true, because #== compares the proxied value"
So, how would this support proxies? Did I miss something important?
And we can think of adding better concurrency control primitives such as a conditional assignment operator.
That would be way less flexible than what we have right now.
Levente
Levente