[squeak-dev] Class names with underscores

Levente Uzonyi leves at elte.hu
Fri Jan 21 23:54:54 UTC 2011


On Fri, 21 Jan 2011, 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
> :)

I disagree with you. All code in the Squeak Trunk image can be compiled 
with the preference turned on or off. If you load code that requires the 
preference to be turned on _and_ you load code at some other time that 
requires it to be off, then it will be problem. But it's very easy to 
solve it, just remove the ambiguity of your methods. (Only ambiguous 
underscore assignments cause problems.)


Levente

>
>>
>> Levente
>>
>
>
>
>
> -- 
> Best regards,
> Igor Stasenko AKA sig.
>


More information about the Squeak-dev mailing list