[squeak-dev] Class names with underscores
Levente Uzonyi
leves at elte.hu
Sat Jan 22 00:00:42 UTC 2011
On Fri, 21 Jan 2011, mkobetic at gmail.com wrote:
> "Levente Uzonyi"<leves at elte.hu> wrote:
>> The default is: underscore assignments are allowed, underscore selectors
>> are not. This is fully backwards compatible.
>> You can enable underscore selectors for your classes (both senders and
>> implementors) in Squeak by implementing the class side method
>> #allowUnderscoreSelectors as ^true.
>> Browsing the source code has some problems due to a bug
>> (http://bugs.squeak.org/view.php?id=7547 ), but the code will work.
>
> OK, just to make sure, since this all talks about selectors. It is OK to have a class with the *class name* with underscores if I add #allowUnderscoreSelectors ^true to it ?
You can create classes with underscores in their name, but if you want to
reference such class from another class, then the other class has to
implement #allowUnderscoreSelectors as returning true, or the preference
has to be turned on.
The class side method doesn't affect the Metaclass, so if you want to
reference a class or send a method with an underscore in it's name from a
class side method, then you have to turn the preference on.
Levente
>
> Thanks for your help,
>
> Martin
>
More information about the Squeak-dev
mailing list
|