No Thing Here vs Uninitialized and RCR 303

J

James Britt

Pit said:
James said:
If you change the behavior of NilClass (e.g., NilClass.blackhole =
true) it is changed for all nil occurrences (nil is a singleton
object, so there is only one instance).

If there are multiple threads running, and one of them decides
NilClass should swallow all unknown methods (even if only during the
execution of a specific block) then all processes will see the same
behavior until some code sets NilClass.blackhole = false.


I don't know whether this would be useful, but you can use thread-local
variables [1] to make this behavior dependent on the current thread. I
can send you the code, if you like.

You can change the workings of a singleton class (NilClass) such that it
behaves differently in separate, simultaneous threads?


James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,477
Members
44,898
Latest member
BlairH7607

Latest Threads

Top