Pharo allows you to use underscores in method selectors.
This is currently in Pharo 1.1 and not 1.0. Does that makes sense to have in Squeak trunk/Cuis too? Try: (HTTPSocket httpGet: 'http://www.assembla.com/spaces/SqueakDBX/documents/dvVhPSvuCr3OqXeJe5aVNr/download/underscore.cs') readStream fileIn And you can implement a method foo_test ^'Works' Makes sense in conjunction with Glorp (when a database column mapped to a class has underscores in it) or FFI (where one can name methods like C constants, ...), ... If it would be in all base images the Glorp loader wouldnt have to patch these. Thx Bye -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 |
On 3/11/10 12:36 PM, "Torsten Bergmann" <[hidden email]> wrote: > Pharo allows you to use underscores in method selectors. > This is currently in Pharo 1.1 and not 1.0. > > Does that makes sense to have in Squeak trunk/Cuis too? > > Try: > > (HTTPSocket httpGet: > 'http://www.assembla.com/spaces/SqueakDBX/documents/dvVhPSvuCr3OqXeJe5aVNr/dow > nload/underscore.cs') readStream fileIn > > And you can implement a method > > foo_test > ^'Works' > > Makes sense in conjunction with Glorp (when a database column > mapped to a class has underscores in it) or FFI (where one > can name methods like C constants, ...), ... > > If it would be in all base images the Glorp loader wouldnt > have to patch these. > > Thx > Bye |
In reply to this post by Torsten Bergmann
2010/3/11 Torsten Bergmann <[hidden email]>:
> Pharo allows you to use underscores in method selectors. > This is currently in Pharo 1.1 and not 1.0. > > Does that makes sense to have in Squeak trunk/Cuis too? No, this is *not* something I'd like to have in Squeak. It's a potential disaster in the long run where either we will be forced to standardize code in some way or live with a basic image/trunk/etc and very weird variable names mixing camel_CameANd_whAtnot beyond the usage of Glorp. o_O (how appropriate!) Ian. -- http://mecenia.blogspot.com/ |
Please no! |
In reply to this post by Torsten Bergmann
On Thu, Mar 11, 2010 at 03:36:43PM +0100, Torsten Bergmann wrote:
> Pharo allows you to use underscores in method selectors. > This is currently in Pharo 1.1 and not 1.0. > > Does that makes sense to have in Squeak trunk/Cuis too? I say support it. Cobalt and Croquet have supported this for years. I have an experimental patch to MC1.5 that converts underscore assignments to := at load time, if the compiler raises a SyntaxError about them. How it works: - Parser throws a syntax error - MC catches the error - MC uses the parser to find underscore assignments (and not underscores in strings/comments/names) and replace them - MC retries compiling the method - If a syntax error is raised again, MC lets it thru and you see the Syntax Error dialog box - If any methods were changed during load, MC tells you about them so you can review them and save the package Note that it's triggered by a SyntaxError, so this will not be done if the preference is to allow underscore assignments. Also, it only fixes things the parser things are disallowed underscore assignments, so it is quite conservative. I use this to prepare packages for loading into Cobalt (where underscores assignments are disallowed by default) -- Matthew Fulmer (a.k.a. Tapple) |
On 3/11/2010 9:54 AM, Matthew Fulmer wrote:
> On Thu, Mar 11, 2010 at 03:36:43PM +0100, Torsten Bergmann wrote: >> Pharo allows you to use underscores in method selectors. >> This is currently in Pharo 1.1 and not 1.0. >> >> Does that makes sense to have in Squeak trunk/Cuis too? > > I say support it. Cobalt and Croquet have supported this for > years. Err, no :-) Underscores are illegal in Croquet. Anywhere. Cheers, - Andreas > I have an experimental patch to MC1.5 that converts > underscore assignments to := at load time, if the compiler > raises a SyntaxError about them. How it works: > > - Parser throws a syntax error > - MC catches the error > - MC uses the parser to find underscore assignments (and not > underscores in strings/comments/names) and replace them > - MC retries compiling the method > - If a syntax error is raised again, MC lets it thru and you see > the Syntax Error dialog box > - If any methods were changed during load, MC tells you about > them so you can review them and save the package > > Note that it's triggered by a SyntaxError, so this will not be > done if the preference is to allow underscore assignments. > > Also, it only fixes things the parser things are disallowed > underscore assignments, so it is quite conservative. > > > I use this to prepare packages for loading into Cobalt (where > underscores assignments are disallowed by default) > |
In reply to this post by Ian Trudel-2
On 11 Mar 2010, at 14:47, Ian Trudel wrote: > 2010/3/11 Torsten Bergmann <[hidden email]>: >> Pharo allows you to use underscores in method selectors. >> This is currently in Pharo 1.1 and not 1.0. >> >> Does that makes sense to have in Squeak trunk/Cuis too? > > No, this is *not* something I'd like to have in Squeak. It's a Absolute necessity, has been second on my list for 5 years. > potential disaster in the long run where either we will be forced to > standardize code in some way or live with a basic image/trunk/etc and > very weird variable names mixing camel_CameANd_whAtnot beyond the > usage of Glorp. I do not think that this follows at all. Keith |
In reply to this post by Sam Adams-2
> Please no!
> That fundamentally changes the readability of Squeak code > no it doesn't It fundamentally gives you many ways to make code more readable. When you have a perform: ('scan_', aChoice) asSymbol this gives you methods #scan_Method #scan_Image #scan_Comment > and makes all future code written that way incompatible with other > Smalltalks. > I don't think so, when I ported SSpec from VW the problem was the other way around, I had to use selectors like zMethod where z should have been an underscore. Mapping to db fields is a pain > And besides, some of us grey beards *like* our assignment arrows! ;-) > You can keep them, just make sure they have whitespace either side of them. > If you really want that then create your own language variant or > maintain your own fork of Squeak. Its not that hard after all, I'm > doing both at present myself! > You dont have to use them if you dont want to. Keith |
In reply to this post by Ian Trudel-2
On 11 March 2010 16:47, Ian Trudel <[hidden email]> wrote:
> 2010/3/11 Torsten Bergmann <[hidden email]>: >> Pharo allows you to use underscores in method selectors. >> This is currently in Pharo 1.1 and not 1.0. >> >> Does that makes sense to have in Squeak trunk/Cuis too? > > No, this is *not* something I'd like to have in Squeak. It's a > potential disaster in the long run where either we will be forced to > standardize code in some way or live with a basic image/trunk/etc and > very weird variable names mixing camel_CameANd_whAtnot beyond the > usage of Glorp. > I don't see any disaster with it. Take another languages, does a presence of underscore in names makes them more beatiful/horrible above anything else? I don't think so. > o_O > (how appropriate!) > > Ian. > -- > http://mecenia.blogspot.com/ > > -- Best regards, Igor Stasenko AKA sig. |
2010/3/11 Igor Stasenko <[hidden email]>:
> On 11 March 2010 16:47, Ian Trudel <[hidden email]> wrote: >> 2010/3/11 Torsten Bergmann <[hidden email]>: >>> Pharo allows you to use underscores in method selectors. >>> This is currently in Pharo 1.1 and not 1.0. >>> >>> Does that makes sense to have in Squeak trunk/Cuis too? >> >> No, this is *not* something I'd like to have in Squeak. It's a >> potential disaster in the long run where either we will be forced to >> standardize code in some way or live with a basic image/trunk/etc and >> very weird variable names mixing camel_CameANd_whAtnot beyond the >> usage of Glorp. >> > > I don't see any disaster with it. Take another languages, does a > presence of underscore in names makes them > more beatiful/horrible above anything else? I don't think so. > To my understanding, there is no need of _ in selectors, BUT for hooking external procedures. It's painful to have to remember two different selectors when you heaviily rely on FFI (OpenGL is a good example indeed). Nicolas >> o_O >> (how appropriate!) >> >> Ian. >> -- >> http://mecenia.blogspot.com/ >> >> > > > > -- > Best regards, > Igor Stasenko AKA sig. > > |
On 11 March 2010 22:35, Nicolas Cellier
<[hidden email]> wrote: > 2010/3/11 Igor Stasenko <[hidden email]>: >> On 11 March 2010 16:47, Ian Trudel <[hidden email]> wrote: >>> 2010/3/11 Torsten Bergmann <[hidden email]>: >>>> Pharo allows you to use underscores in method selectors. >>>> This is currently in Pharo 1.1 and not 1.0. >>>> >>>> Does that makes sense to have in Squeak trunk/Cuis too? >>> >>> No, this is *not* something I'd like to have in Squeak. It's a >>> potential disaster in the long run where either we will be forced to >>> standardize code in some way or live with a basic image/trunk/etc and >>> very weird variable names mixing camel_CameANd_whAtnot beyond the >>> usage of Glorp. >>> >> >> I don't see any disaster with it. Take another languages, does a >> presence of underscore in names makes them >> more beatiful/horrible above anything else? I don't think so. >> > > To my understanding, there is no need of _ in selectors, BUT for > hooking external procedures. > It's painful to have to remember two different selectors when you > heaviily rely on FFI (OpenGL is a good example indeed). > First, i think we should answer to a simple question: why many other computer languages allow underscores in their syntax as a valid character for identifiers. As to me, the answer is obvious: in natural languages we using space to separate two words, and since parsers can't cope (or can, but its highly impractical) with identifiers which having spaces: my variable := foo. an underscore is a good compromise between natural language and computer language to separate two words, while treat it as a single identifier: my_variable := foo. I came to smalltalk not long ago, and having over 15+ years of programming experience. I am always used underscores in this way, and never (or occasionally) like this: _abdomination := foo. Smalltalk spirit is a language which designed to remove unnecessary barriers between humand and computer - easy to learn and easy to express yourself, without need to be a highly educated genius who can translate a natural human language to a cryptic sequece of instructions which computer can understand. And allowing underscores in identifiers, as to me, is highly coherent with that spirit, because it this makes us easier to express ourselves. > Nicolas > -- Best regards, Igor Stasenko AKA sig. |
Does VW support underscores in selectors?
I'd worry about two things: - compatibility (which is already awful) - collision with assignment semantics when importing code that still uses the underscore/arrow. On Thursday, March 11, 2010, Igor Stasenko <[hidden email]> wrote: > On 11 March 2010 22:35, Nicolas Cellier > <[hidden email]> wrote: >> 2010/3/11 Igor Stasenko <[hidden email]>: >>> On 11 March 2010 16:47, Ian Trudel <[hidden email]> wrote: >>>> 2010/3/11 Torsten Bergmann <[hidden email]>: >>>>> Pharo allows you to use underscores in method selectors. >>>>> This is currently in Pharo 1.1 and not 1.0. >>>>> >>>>> Does that makes sense to have in Squeak trunk/Cuis too? >>>> >>>> No, this is *not* something I'd like to have in Squeak. It's a >>>> potential disaster in the long run where either we will be forced to >>>> standardize code in some way or live with a basic image/trunk/etc and >>>> very weird variable names mixing camel_CameANd_whAtnot beyond the >>>> usage of Glorp. >>>> >>> >>> I don't see any disaster with it. Take another languages, does a >>> presence of underscore in names makes them >>> more beatiful/horrible above anything else? I don't think so. >>> >> >> To my understanding, there is no need of _ in selectors, BUT for >> hooking external procedures. >> It's painful to have to remember two different selectors when you >> heaviily rely on FFI (OpenGL is a good example indeed). >> > > First, i think we should answer to a simple question: why many other > computer languages allow underscores in their syntax as a > valid character for identifiers. > As to me, the answer is obvious: in natural languages we using space > to separate two words, and since parsers can't cope (or can, but its > highly impractical) with identifiers which having spaces: > > my variable := foo. > > an underscore is a good compromise between natural language and > computer language to separate two words, > while treat it as a single identifier: > > my_variable := foo. > > I came to smalltalk not long ago, and having over 15+ years of > programming experience. > I am always used underscores in this way, and never (or occasionally) like this: > > _abdomination := foo. > > > Smalltalk spirit is a language which designed to remove unnecessary > barriers between humand and computer - easy to learn and easy to > express yourself, without need to be a highly educated > genius who can translate a natural human language to a cryptic sequece > of instructions which computer can understand. > And allowing underscores in identifiers, as to me, is highly coherent > with that spirit, because it this makes us easier to express > ourselves. > >> Nicolas >> > > > -- > Best regards, > Igor Stasenko AKA sig. > > -- Casey Ransberger |
On 11 Mar 2010, at 23:41, Casey Ransberger wrote: > Does VW support underscores in selectors? I believe so, since SSpec from Dave Astels was written with them Keith |
In reply to this post by Torsten Bergmann
In the mind of some I did not make myself clear so allow
me to restate my position. I am FOR supporting the use of '_' in selectors, variable names, class names, anywhere else where characters a-z,A-Z may be used to construct identifiers. That said, I will rarely if ever use this feature. I actually like being able to use '_' for assignment (drawn as an arrow) so I don't see the point of removing the use of '_' for assignment unless we intend to use it elsewhere. I am also against compiler flags or other methods of allowing some to use '_' for assignment or allowing or disallowing use of '_' in selectors, etc. > Until now we have: > PRO > - Torsten > - Edgar > - Bert > - Alexander > - Matthew > - Keith > - Igor > CONTRA > - Ian Trudel > - Sam > SCOPING > - Andreas (but vote PRO depend on backwards compatibility aspect) > - Stéphane (votes for scoping) NOT CLEARLY STATED > - Louis > - Randal (vote seem to depend on Preference, which we now have) > - Radoslav (but would rather ban underscore assignment, than underscores in method names) > - Ralph Boland > - Nicolas Regards, Ralph Boland |
Free forum by Nabble | Edit this page |