okay. That makes sense and is nicer, and this sparked a new thought... While you might have other use cases, for that specific one case how about something like:Igor Stasenko wrote:
On 2 May 2013 16:56, Frank Shearar <frank.shearar@gmail.com> wrote:
�
On 2 May 2013 15:37, Ben Coman <btc@openinworld.com> wrote:yes, so you write:
� �
Sven Van Caekenberghe wrote:But the use case here is when you want to reference a class that has
� � �
On 02 May 2013, at 06:03, Igor Stasenko <siguctua@gmail.com> wrote:#asGlobal feels confusing to me. �It doesn't sound like a lookup. � Some
� � � �
Hi, allConfigurationOfXYZ globalValue project bleedingEdge load.
do not think that i am drunk or vent crazy, asking such silly
question, which at best should be asked only by beginner :)
I know the answer:
Smalltalk at: #SomeName
or
Smalltalk globals at: #SomeName
what stroke me, just now, that both answers is wrong!
It should be:
#SomeName asGlobal
(or suggest more appropriate/precise method name for a symbol)
� � � � �
ConfigurationOfXYZ globalValueIfPresent: [ :configuration | configuration
project bleedingEdge load ]
An alternative could be globalBinding, but that is more technical.
#asGlobal sounds like a conversion, on the other hand it is an accepted
idiom.
� � � �
other alternatives:
#SomeName fromGlobal
#SomeName from: someOtherEnvironment
#SomeName fromEnvironment � � "the current one"
#SomeName fromEnvironment: someOtherEnvironment
#SomeName fromEnv: someOtherEnvironment
#SomeName fromEnv � � "the current one"
but why bother at all. �What is the advantage over this:
Smalltalk at: #xx put: 1.
xx inspect.
� � �
not yet been loaded, which happens every time you run a load script
for a ConfigurationOf.
� �
#ConfigurationOfXYZ asClass load.
instead of:
(Smalltalk at: #ConfigurationOfXYZ) load.
�
frank
� �
�
#XYZ configuration load.
cheers -ben