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