[squeak-dev] Re: Can i has underscores? :)

Igor Stasenko siguctua at gmail.com
Thu Apr 15 00:43:57 UTC 2010


On 15 April 2010 03:26, Juan Vuletich <juan at jvuletich.org> wrote:
> Igor Stasenko wrote:
>>
>> On 15 April 2010 00:38, Juan Vuletich <juan at jvuletich.org> wrote:
>>
>>>
>>> Hi Igor,
>>>
>>> So, what you want is:
>>>
>>> Igor Stasenko wrote:
>>>
>>>>
>>>> ... i see a following benefits:
>>>>  - better interoperability with other languages (most modern languages
>>>> using underscores in identifiers)
>>>>
>>>>
>>>
>>> You already have that, just turn on the preference. There are a few
>>> issues
>>> left, today I sent some fixes for those, in a message that was ignored.
>>>
>>>
>>
>> it was not ignored. Not by me :) I downloaded your code once i seen
>> the message and want to try it out later.
>> But it is probably will not be integrated before release, so that's
>> why i think it was not attracted much attention.
>>
>
> Good to know!
>
>>>>  - better visual appearance of source code (seeing a := b is a way
>>>> better than seeing a _ b )
>>>>
>>>>
>>>
>>> You always had that.
>>>
>>>
>>
>> Not always. There are still a lot of old code in sources, which using
>> underscore assignments.
>> I'd prefer to never stumble over that again :)
>>
>
> Shout can do that for you. And if you save such method, it will use your
> preference. I use it to convert any method I save in Cuis to use left arrow
> :)
>
Err.. let me tell you what will happen if i, say, add an instance
variable to some basic class -
it will recompile all subclasses. And when some of those methods could
contain underscores as assignment,
while some of them (a newer ones) could use underscores in
selectors/identifiers.
No matter what you choose in a system-wide preference, you won't be
able to recompile the all classes.
Will Shout be able to help me with that? :)
It is obvious, that to prevent this from happening, all sources, which
is going to the compiler, should
use same syntax, or each class should have own #useUnderscores setting.
But that wouldn't help, if i add an instance variable with underscore
in base class,
while subclass will still insist on using underscores for assignment -
then it will be unable to access that ivar
in own methods :)

>>> So, what is missing? The import filter to convert existing code to suit
>>> your
>>> taste; the one you're not programming because it is not that important
>>> for
>>> you? Something else?
>>>
>>>
>>
>> It is not about my taste, it is about a decision i have to make,
>> what code to generate with my OpenGL stuff. Either use underscores freely
>> or
>> collapse them and let users to deal with consequences and with
>> inability to have 1:1
>> correspondence with OpenGL identifiers.
>> Try read this one:
>> COMPRESSED_SIGNED_RED_RGTC1
>> COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
>> and this:
>> COMPRESSEDSIGNEDREDRGTC1
>> COMPRESSEDSRGBALPHAS3TCDXT5EXT
>>
>> Yes, these names are ugly as C is. But that's not the point.
>> The point is, that OpenGL is a widely adopted standard, which i like
>> to bring to Squeak.
>> And it is obvious to me, that retaining an original formatting is
>> better for any potential user.
>>
>
> Why are you still speaking as if you couldn't use underscores in identifiers
> when in fact you can? Or if someone had told you that you shouldn't? I guess
> most people (me included) believe it is better to use them in this case!
>
Well, my first question was 'i can?'. It appeared that i can't (but i
will try your fixes).
Also, how you suppose to deal with the above (recompiling a base class)?

> Cheers,
> Juan Vuletich
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list