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

Alexander Lazarević laza at blobworks.com
Wed Apr 14 10:25:47 UTC 2010


After setting the "Allow underscore selectors" preference to true in
4.1.1 I just created a class MyClass with the method foo_bar and
MyClass new foo_bar returns 10?!

I can't say why the note about the new sources file pops up on this though.

Alex

2010/4/14 Igor Stasenko <siguctua at gmail.com>:
> I checked, that in Pharo image i could simply use:
>
> foo_bar
>
>        a_b := 5.
>        FOO_BAR := 10.
>
>        ^ FOO_BAR
>
> and it works!
>
> It would be cool to have similar in squeak, even if it may require to
> define something like:
>
> MyClass class>>canIHasUnderscores
>  ^ true
>
> It would be really nice to have, especially for things like OpenGL
> API, which using underscores in constant names.
> Exterminating underscores in those identifiers makes them really hard
> to read , and awkward to use, because
> every time you going to code something, first you usually refer to
> docs, where you see these names with underscores,
> but then once you going to type this name it costs you an additional
> mental effort - don't forget to skip underscores.
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
>



More information about the Squeak-dev mailing list