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 >There's a lot of code that uses at least x_ foo (i.e., no space between >var name and underscore). With the Preference disabled you have Squeak as it was before and there should be no problem to load this code. At least if you dont have packages with "_" selectors. And if thats not enough a simple lint rule can check that _ selectors are not used in a base/core image. I dont know about the Etoys codebase that much but is it really relying on the missing space here? If not the code can be automatically converted while loading as Matthew suggested in [1] today. An alternative would be to do the homework (as with other stuff like #fixTemps and friends) and update the code when moving to newer Squeak?! The Refactoring browser also has a nice function to convert _ to := assignments (in the lint tool). >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? Scoping? Why? A preference is a) simple b) settable by the image owner who is able to decide if he wants to allow it or not (same as with underscores) >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. You mean this for real? I thought we would clean up the system instead of putting anything into (already bloated) base classes .... ;) And is it a class who allows underscore selectors or is it the compiler? Bye Torsten [1] http://lists.squeakfoundation.org/pipermail/squeak-dev/2010-March/146419.html -- GMX DSL: Internet, Telefon und Entertainment für nur 19,99 EUR/mtl.! http://portal.gmx.net/de/go/dsl02 |
>>>>> "Torsten" == Torsten Bergmann <[hidden email]> writes:
Torsten> - Randal (vote seem to depend on Preference, which we now have) I know there's a flag that disables _ as assignment, but is there also a flag that *enables* _ within an identifier? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[hidden email]> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion |
2010/3/11 Randal L. Schwartz <[hidden email]>:
>>>>>> "Torsten" == Torsten Bergmann <[hidden email]> writes: > > Torsten> - Randal (vote seem to depend on Preference, which we now have) > > I know there's a flag that disables _ as assignment, > but is there also a flag that *enables* _ within an identifier? > Not yet. > -- > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 > <[hidden email]> <URL:http://www.stonehenge.com/merlyn/> > Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. > See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion > > |
In reply to this post by Torsten Bergmann
I'm for having underscores in selectors, and a preference seems like a simple enough solution On Thu, 11 Mar 2010, Torsten Bergmann wrote: > 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 > >> There's a lot of code that uses at least x_ foo (i.e., no space between >var name and underscore). > > With the Preference disabled you have Squeak as it was before and > there should be no problem to load this code. At least if you dont > have packages with "_" selectors. And if thats not enough a simple > lint rule can check that _ selectors are not used in a base/core image. > > I dont know about the Etoys codebase that much but is it really relying > on the missing space here? > > If not the code can be automatically converted while loading as Matthew > suggested in [1] today. An alternative would be to do the homework > (as with other stuff like #fixTemps and friends) and update the > code when moving to newer Squeak?! > > The Refactoring browser also has a nice function to convert _ to := assignments (in the lint tool). > > >> 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? > > Scoping? Why? A preference is > a) simple > b) settable by the image owner who is able to decide if he > wants to allow it or not (same as with underscores) > >> 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. > > You mean this for real? I thought we would clean up the system > instead of putting anything into (already bloated) base classes .... ;) > > And is it a class who allows underscore selectors or is it the compiler? > > Bye > Torsten > > [1] http://lists.squeakfoundation.org/pipermail/squeak-dev/2010-March/146419.html > -- > GMX DSL: Internet, Telefon und Entertainment für nur 19,99 EUR/mtl.! > http://portal.gmx.net/de/go/dsl02 > |
Seems like underscores in selectors should be allowed. A single underscore as a selector would mean assignment.
I don't personally like underscores as assignment but they could be allowed by preference but only if they had whitespace either side. x _ z would be ok equivalent to x := z And disallow underscore as assignment without whitespace either side. x_ z or x_z not ok for assignment, they would be taken as selectors. And encouragement should be provided for preferentially using := going forward. Seems like a simple enough solution, or am I missing something? Ken G. Brown At 11:04 PM +0100 3/11/10, radoslav hodnicak apparently wrote: >I'm for having underscores in selectors, and a preference seems like a simple enough solution > >On Thu, 11 Mar 2010, Torsten Bergmann wrote: > >>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 >> >>>There's a lot of code that uses at least x_ foo (i.e., no space between >var name and underscore). >> >>With the Preference disabled you have Squeak as it was before and >>there should be no problem to load this code. At least if you dont >>have packages with "_" selectors. And if thats not enough a simple >>lint rule can check that _ selectors are not used in a base/core image. >> >>I dont know about the Etoys codebase that much but is it really relying >>on the missing space here? >> >>If not the code can be automatically converted while loading as Matthew >>suggested in [1] today. An alternative would be to do the homework >>(as with other stuff like #fixTemps and friends) and update the >>code when moving to newer Squeak?! >> >>The Refactoring browser also has a nice function to convert _ to := assignments (in the lint tool). >> >>>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? >> >>Scoping? Why? A preference is >> a) simple >> b) settable by the image owner who is able to decide if he >> wants to allow it or not (same as with underscores) >> >>>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. >> >>You mean this for real? I thought we would clean up the system >>instead of putting anything into (already bloated) base classes .... ;) >> >>And is it a class who allows underscore selectors or is it the compiler? >> >>Bye >>Torsten >> >>[1] http://lists.squeakfoundation.org/pipermail/squeak-dev/2010-March/146419.html >>-- >>GMX DSL: Internet, Telefon und Entertainment für nur 19,99 EUR/mtl.! >>http://portal.gmx.net/de/go/dsl02 |
In reply to this post by Torsten Bergmann
>> 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? > > Scoping? Why? A preference is > a) simple > b) settable by the image owner who is able to decide if he > wants to allow it or not (same as with underscores) scoping makes it possible to load code using selectors with underscores in an image where most classes still use underscores for assignments. I do not see any other way to avoid forcing everybody to review their code and check all assignments. plus, if underscores in methods are mostly useful when interfacing with external blobs as Nicolas put it, a per-class scoping makes sense since only classes involved with the blob would really need underscored selectors. so, scoping gives the functionality you want and gives all other people confidence that their code won't break. how do other solutions compare ? Stef |
In reply to this post by Ken G. Brown
> Seems like underscores in selectors should be allowed. A single underscore as a selector would mean assignment.
> > I don't personally like underscores as assignment but they could be allowed by preference but only if they had whitespace either side. > > x _ z would be ok equivalent to x := z > > And disallow underscore as assignment without whitespace either side. > > x_ z or x_z not ok for assignment, they would be taken as selectors. > > And encouragement should be provided for preferentially using := going forward. > Seems like a simple enough solution, or am I missing something? that's fine AFAIC Stef |
In reply to this post by Torsten Bergmann
> 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 > >> There's a lot of code that uses at least x_ foo (i.e., no space >> between >var name and underscore). > > With the Preference disabled you have Squeak as it was before and > there should be no problem to load this code. At least if you dont > have packages with "_" selectors. And if thats not enough a simple > lint rule can check that _ selectors are not used in a base/core > image. > As far as I can see the preference is redundant. "If you don't want it don' t use it." - I think that covers the situation as well as it can be covered. What additional feature does having a preference give you? Apart form an extra preference? I agree that the compilerClass hook may be better than an extra special method. However does the compilerClass hook apply to both class side and instance side method compilations? Keith |
In reply to this post by Stéphane Rollandin
I think Stef's scoping idea is an excellent compromise. Please move my vote there.
>> 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? > > Scoping? Why? A preference is > a) simple > b) settable by the image owner who is able to decide if he > wants to allow it or not (same as with underscores) scoping makes it possible to load code using selectors with underscores in an image where most classes still use underscores for assignments. I do not see any other way to avoid forcing everybody to review their code and check all assignments. plus, if underscores in methods are mostly useful when interfacing with external blobs as Nicolas put it, a per-class scoping makes sense since only classes involved with the blob would really need underscored selectors. so, scoping gives the functionality you want and gives all other people confidence that their code won't break. how do other solutions compare ? Stef pic17892.gif (1K) Download Attachment |
In reply to this post by Stéphane Rollandin
Andreas states my feelings about "history" much better than I could. |
Free forum by Nabble | Edit this page |