On Thu, 22 Jul 2010, Lukas Renggli wrote:
I see two problems with this:
1. #World asClass does not return a class.
#classNamed: can solve this.
2. We are trying to remove all direct references to the Smalltalk
namespace, this however hardcodes the Smalltalk namespace again.
self environment can solve this.
Levente
Lukas
2010/7/22 Guillermo Polito <[email protected]>:
why not let #asClass raise an error and make another one like
Symbol>>asClassIfAbsent: aBlock
^Smalltalk globals at: self ifAbsent: aBlock.
?
On Thu, Jul 22, 2010 at 10:45 AM, Stéphane Ducasse
<[email protected]> wrote:
now after some thinking. I'm wondering why this is good addition or the
name could be better.
I do not know... thinking aloud.
sounds cool :)
VAST has an #asClass method on Symbol that does more or less this:
Symbol >> #asClass
^ Smalltalk at: self
What about this?
^Smalltalk at: self ifAbsent: nil
^Smalltalk globals at: self ifAbsent: nil
So one could also write:
#MyClass asClass ifNotNil: [ :myClass | ... ]
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
--
Lukas Renggli
www.lukas-renggli.ch
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project