Probably Underscores Again (Re: SmaCC and Croquet SDK 1.0 Beta)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Probably Underscores Again (Re: SmaCC and Croquet SDK 1.0 Beta)

Joshua Gargus
It's likely that SmaCC uses underscores in its code.  This is  
disabled by default in Croquet (you can see recent discussions of  
this on both the Croquet and Squeak mailing lists).  To enable the  
use of underscores, evaluate 'Preferences enable:  
#allowUnderscoreAssignment' in a Workspace.  In the long term, it  
would be better if package managers move away from the use of  
underscore assignments.

Josh


On May 5, 2006, at 11:49 AM, Ferdinand Strixner wrote:

> Hi,
>
> have been starting to play around with the new 1.0 beta release of  
> the Croquet SDK and tried to integrate the full version of the  
> SmaCC parser generator into the Croquet image (only the runtime  
> version seems to be included by default). The package "SmaCC  
> Development for <=3.8" loads without a problem in the current 3.8  
> version of Squeak when using the package loader but if I try the  
> same in Croquet I get syntax errors in methods like:  
> "SmaCCCodeHolder menus contentsMenu:shifted:". Is there a version  
> of SmaCC that is compatible with the current Croquet image or an  
> easy way to load a halfway recent SmaCC version into the Croquet  
> 1.0 SDK?
>
> Thanks and greetings,
> Ferdinand
>

Joshua Gargus
Senior Croquet Developer, http://croquetproject.org
DoIT Academic Technology, http://www.wisc.edu/academictech
University of Wisconsin-Madison
1301 University Avenue, Madison, WI, USA 53715
608-265-9891



Reply | Threaded
Open this post in threaded view
|

Re: Probably Underscores Again (Re: SmaCC and Croquet SDK 1.0 Beta)

Ferdinand Strixner
Hi Josh,

thanks for your help, that was indeed the problem! (This strict
underscores-forbidden setting is a iittle bit irritating for newbies
(like me), perhaps one could replace the syntax error with some kind of
deprecation warning or something like that?)

Greetings,
Ferdinand

Joshua Gargus schrieb:

> It's likely that SmaCC uses underscores in its code.  This is disabled
> by default in Croquet (you can see recent discussions of this on both
> the Croquet and Squeak mailing lists).  To enable the use of
> underscores, evaluate 'Preferences enable: #allowUnderscoreAssignment'
> in a Workspace.  In the long term, it would be better if package
> managers move away from the use of underscore assignments.
>
> Josh
>
>
> On May 5, 2006, at 11:49 AM, Ferdinand Strixner wrote:
>
>> Hi,
>>
>> have been starting to play around with the new 1.0 beta release of the
>> Croquet SDK and tried to integrate the full version of the SmaCC
>> parser generator into the Croquet image (only the runtime version
>> seems to be included by default). The package "SmaCC Development for
>> <=3.8" loads without a problem in the current 3.8 version of Squeak
>> when using the package loader but if I try the same in Croquet I get
>> syntax errors in methods like: "SmaCCCodeHolder menus
>> contentsMenu:shifted:". Is there a version of SmaCC that is compatible
>> with the current Croquet image or an easy way to load a halfway recent
>> SmaCC version into the Croquet 1.0 SDK?
>>
>> Thanks and greetings,
>> Ferdinand
>>
>
> Joshua Gargus
> Senior Croquet Developer, http://croquetproject.org
> DoIT Academic Technology, http://www.wisc.edu/academictech
> University of Wisconsin-Madison
> 1301 University Avenue, Madison, WI, USA 53715
> 608-265-9891
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Probably Underscores Again (Re: SmaCC and Croquet SDK 1.0 Beta)

Kyle Hamilton
In reply to this post by Joshua Gargus
I find it rather odd...

Every Smalltalk language tutorial I've seen has introduced underscore
assignment first, and only after that stated that := can be used as a
synonym.

Given that (and remember, please, that I am a newbie and I don't know
the language or any of the arguments on one side or the other), why
disable _ as an assignment operator?

-Kyle H

On 5/5/06, Joshua Gargus <[hidden email]> wrote:
> It's likely that SmaCC uses underscores in its code.  This is
> disabled by default in Croquet (you can see recent discussions of
> this on both the Croquet and Squeak mailing lists).  To enable the
> use of underscores, evaluate 'Preferences enable:
> #allowUnderscoreAssignment' in a Workspace.  In the long term, it
> would be better if package managers move away from the use of
> underscore assignments.
>
> Josh

Reply | Threaded
Open this post in threaded view
|

Re: Probably Underscores Again (Re: SmaCC and Croquet SDK 1.0 Beta)

Joshua Gargus
In reply to this post by Joshua Gargus
Looking in the squeak-dev archives, this has been an issue since at  
least 2000.  One major reason is that people want to use underscores  
in identifiers.  For example, it would be nice if the OpenGL constant  
GL_COMPILE_AND_EXECUTE could be written this way in Croquet, rather  
than as GLCompileAndExecute.  Disallowing underscore as the  
assignment operator is a first step toward this.

Josh



On May 7, 2006, at 4:44 PM, Kyle Hamilton wrote:

> I find it rather odd...
>
> Every Smalltalk language tutorial I've seen has introduced underscore
> assignment first, and only after that stated that := can be used as a
> synonym.
>
> Given that (and remember, please, that I am a newbie and I don't know
> the language or any of the arguments on one side or the other), why
> disable _ as an assignment operator?
>
> -Kyle H
>
> On 5/5/06, Joshua Gargus <[hidden email]> wrote:
>> It's likely that SmaCC uses underscores in its code.  This is
>> disabled by default in Croquet (you can see recent discussions of
>> this on both the Croquet and Squeak mailing lists).  To enable the
>> use of underscores, evaluate 'Preferences enable:
>> #allowUnderscoreAssignment' in a Workspace.  In the long term, it
>> would be better if package managers move away from the use of
>> underscore assignments.
>>
>> Josh
>

Joshua Gargus
Senior Croquet Developer, http://croquetproject.org
DoIT Academic Technology, http://www.wisc.edu/academictech
University of Wisconsin-Madison
1301 University Avenue, Madison, WI, USA 53715
608-265-9891



Reply | Threaded
Open this post in threaded view
|

Re: Probably Underscores Again (Re: SmaCC and Croquet SDK 1.0 Beta)

Andreas.Raab
In reply to this post by Joshua Gargus
Hi Kyle -

It was never supposed to be underscore assignment. Originally, the
left-arrow glyph was used for assignment (and there is really nothing
wrong with that). But since the dawn of computer days, both character
sets and keyboards have changed and in most of todays fonts and
keyboards there is no left-arrow character. This led to a hack where the
underscore code point was hijacked in some of Squeak's fonts and
replaced with a left-arrow glyph. With the consequence that
a) Everything that uses underscores for its reasons suddenly looked
very, very weird inside Squeak (like GL_FOO_BAR becoming GL<-FOO<-BAR)
b) Everything that uses left-arrow assignment suddenly looked very, very
weird outside Squeak (this is really where the whole "underscore for
assignment" comes from, e.g., from a broken rendering of the left-arrow
glyph)
c) Using other than the default fonts leads to major code readability
issues (not even the most die-hard left-arrow users disagree that an
underscore as an assignment operator looks just horrific)
c) People get confused all the time (one way or another) like wondering
where they find the left-arrow glyph on their keyboard etc.

Coincidentally if "every Smalltalk language tutorial you've ever seen
introduced underscore assignment first" you should check out the free
books collection at http://www.iam.unibe.ch/~ducasse/FreeBooks.html - I
doubt that many (if any) of those use underscore assignment; if anything
they would probably use left-arrow.

Cheers,
   - Andreas

Kyle Hamilton wrote:

> I find it rather odd...
>
> Every Smalltalk language tutorial I've seen has introduced underscore
> assignment first, and only after that stated that := can be used as a
> synonym.
>
> Given that (and remember, please, that I am a newbie and I don't know
> the language or any of the arguments on one side or the other), why
> disable _ as an assignment operator?
>
> -Kyle H
>
> On 5/5/06, Joshua Gargus <[hidden email]> wrote:
>> It's likely that SmaCC uses underscores in its code.  This is
>> disabled by default in Croquet (you can see recent discussions of
>> this on both the Croquet and Squeak mailing lists).  To enable the
>> use of underscores, evaluate 'Preferences enable:
>> #allowUnderscoreAssignment' in a Workspace.  In the long term, it
>> would be better if package managers move away from the use of
>> underscore assignments.
>>
>> Josh
>
>