[squeak-dev] Re: Selectors with underscores

Josh Gargus josh at schwa.ca
Fri Mar 12 15:55:44 UTC 2010


I like the per-class scoping idea.

I don't personally have any method-selectors that I want to use underscores in, but I do have lots of constants that I'd like underscores in.  For example, OpenCL has hundreds of constants along the lines of CL_MEM_READ_WRITE (and OpenGL has even more).

It would be inconvenient if every class using the pool dictionary OpenCLConstants had to explicitly enable the use of underscores.  Ideal, the user's intent would be implicit in the choice to use that pool dictionary.

Cheers,
Josh



On Mar 11, 2010, at 9:59 AM, Andreas Raab wrote:

> On 3/11/2010 9:10 AM, Torsten Bergmann wrote:
>> If true an underscore is accepted and any code with underscores
>> is loadable without patching the image/Scanner class.
>> 
>> Does that satisfy anybody?
>> 
>> Please feel free to review and integrate if accepted.
> 
> I did a quick adoption of your code to print out all sites that would be compiled differently and run it in trunk where it resulted in only one site needing change (PNGReadWritre>>test1). Then I ran it in an Etoys-dev image and the result was significantly different. There's a lot of code that uses at least x_ foo (i.e., no space between var name and underscore).
> 
> I'm wondering: I don't really know how the people who want underscores plan to use this, but would it make sense to scope this differently, i.e., either on a per-class or even a per-method basis?
> 
> Per class would be my favorite because in a system where you'd like to use underscores globally you'd just have Object class>>allowUnderscoreSelectors return true. And in other systems you could still have MyGlorpConnector>>allowUnderscoreSelectors enabling it for the cases you care about.
> 
> Cheers,
>  - Andreas
> 




More information about the Squeak-dev mailing list