[squeak-dev] Re: Class names with underscores

Andreas Raab andreas.raab at gmx.de
Sat Jan 22 09:31:04 UTC 2011


On 1/21/2011 5:50 PM, Igor Stasenko wrote:
> On 21 January 2011 17:39, Levente Uzonyi<leves at elte.hu>  wrote:
>> On Fri, 21 Jan 2011, mkobetic at gmail.com wrote:
>>
>>> "Igor Stasenko"<siguctua at gmail.com>  wrote:
>>>>
>>>> if you set  'use underscore for selectors' and disable 'underscore for
>>>> assignments' in preferences then class names should work as well,
>>>> AFAIK.
>>>
>>> But if that's not how most people will run Squeak, then that's not a
>>> reasonable option for me. What are the default settings and are they likely
>>> to ever change ?
>>
>> 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.
>>
> No only that.
>
> You can't safely recompile source at will, like:
> Compiler recompileAll
> because parts of code could be filed in using one setting, and other
> code loaded when setting is different.
> So, you have to live with worst possible solution between:
>    - having cake, but can't eat it
>    - not having cake, but attempt to eat it
> :)

The global preference is intended to make fileIns work for the first 
time. To keep your underscore preferences consistent within your code 
see Behavior>>allowUnderscoreSelectors and 
Behavior>>allowUnderscoreAssignments.

It's not perfect since it should be on a package-basis but it's better 
than nothing.

Cheers,
   - Andreas



More information about the Squeak-dev mailing list