On Fri, Apr 10, 2015 at 2:35 PM, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
The Gofer script does not solve the problem of triggering a special loading selector in the ConfigurationOfXYZ. Furthermore, asClass can be used for other usages as well, but it is clear that it is intended for scripts and not for production code. For example, I recently sent around a script that showed this:
Object subclass: #AClass instanceVariableNames: '' classVariableNames: '' category: 'XYZ'. #AClass asClass compile: 'someMethod'. ...
That's how some methods are patched upon system startup in a startup script of mine. Some value ranges etc can be set by a sysadmin in a couple files.
I do agree that checking the existence of classes should not happen explicitly in code. For example, the code in Brick that checks for classes should not exist at all.
However, removing asClass will only change the way a class can be looked up from a string. It will still not prevent people to look classes up by symbols in the code. In my mind: - saying: "#AClass asClass" - should have the same semantics as saying "AClass"
+1
All in all, I think asClass has a legitimate usage, but we should certainly combat explicit class checking in code.
+1 x 2
Cheers, Doru
-- --- Philippe Back Visible Performance Improvements Mob: +32(0) 478 650 140 | Fax: +32 (0) 70 408 027 Mail:phil@highoctane.be | Web: http://philippeback.eu Blog: http://philippeback.be | Twitter: @philippeback Youtube: http://www.youtube.com/user/philippeback/videos High Octane SPRL rue cour Boisacq 101 | 1301 Bierges | Belgium Pharo Consortium Member - http://consortium.pharo.org/ Featured on the Software Process and Measurement Cast - http://spamcast.libsyn.com Sparx Systems Enterprise Architect and Ability Engineering EADocX Value Added Reseller