Am 02.05.2013 um 13:45 schrieb Norbert Hartl <norbert@hartl.name>:
Am 02.05.2013 um 06:03 schrieb Igor Stasenko <siguctua@gmail.com>:
#SomeName asGlobal
(or suggest more appropriate/precise method name for a symbol)
I think if you write
asGlobalWhat?
the problems with this becomes visible. As Steph wrote there is asClass which does it for the case you are looking for a class. I'm not sure how common the use case
Smalltalk at: #foo put: somethingThatIsNotAClass
is. Your selector is somewhat orthogonal to asClass as you define access via reachability and not via type. But trying to imagine the future asGlobal is not a good selector. At least I hope the "global" will go away completely. In that case it wouldn't be good to rely on. Another possibility that would make sense is
asBinding (or a better name)
what about #bound or even #bind ? can be extended to #boundObject ⦠Best -Tobias
but that would only be good if it would search scopes upwards. So it can look into e.g. block -> method -> class -> environment -> ? And that would defeat the purpose of your mail in another way.
So what is your rationale? My gut says I like the idea but I can't think of a useful selector/concept to make it a viable option.
Norbert