The assignment character in 3.9 and onward

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

The assignment character in 3.9 and onward

Duncan Mak-2
Hello all,

What is the concensus to the assignment character issue in 3.9?

I understand the desire to let the underscore be underscore, and not hijack it to be <-, I agree with that 100%.

However, I believe that quite a few of us still prefer to see the <- displayed instead of the newer :=. At least, I'd prefer a 2 keypresses than 3 keypresses (shift, semicolon, equal) for entering the assignment operator.

I propose the following:

1) Outside of the code display within Squeak, always use := because the <- is not available anywhere else.

2) Inside Squeak, let it be a preference to allow the user to choose between := and <- for the glyph used to display the assignment operator.

3) Add Ctrl-= as an additional keybinding for entering the assignment operator. This way, there's a 2-keypress way for entering assignment again.

Would it be a big performance hit if the source code is always stored using :=, and add a method to StringHolderView or PluggableTextView to convert from := to -> when displaying code?

Duncan.


Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

stéphane ducasse-2
Have a look there is a preference.
Now for harvesting purpose this is highly important that we get the  
same convention in the source code.

Stef

On 4 juin 06, at 02:05, Duncan Mak wrote:

> Hello all,
>
> What is the concensus to the assignment character issue in 3.9?
>
> I understand the desire to let the underscore be underscore, and  
> not hijack it to be <-, I agree with that 100%.
>
> However, I believe that quite a few of us still prefer to see the  
> <- displayed instead of the newer :=. At least, I'd prefer a 2  
> keypresses than 3 keypresses (shift, semicolon, equal) for entering  
> the assignment operator.
>
> I propose the following:
>
> 1) Outside of the code display within Squeak, always use := because  
> the <- is not available anywhere else.
>
> 2) Inside Squeak, let it be a preference to allow the user to  
> choose between := and <- for the glyph used to display the  
> assignment operator.
>
> 3) Add Ctrl-= as an additional keybinding for entering the  
> assignment operator. This way, there's a 2-keypress way for  
> entering assignment again.
>
> Would it be a big performance hit if the source code is always  
> stored using :=, and add a method to StringHolderView or  
> PluggableTextView to convert from := to -> when displaying code?
>
> Duncan.
>


Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

stéphane ducasse-2
I realized that the preference may not be what you suggest.
In that case propose an enh. Indeed this is important that all the  
code is store using one convention.

On 4 juin 06, at 09:55, stéphane ducasse wrote:

> Have a look there is a preference.
> Now for harvesting purpose this is highly important that we get the  
> same convention in the source code.
>
> Stef
>
> On 4 juin 06, at 02:05, Duncan Mak wrote:
>
>> Hello all,
>>
>> What is the concensus to the assignment character issue in 3.9?
>>
>> I understand the desire to let the underscore be underscore, and  
>> not hijack it to be <-, I agree with that 100%.
>>
>> However, I believe that quite a few of us still prefer to see the  
>> <- displayed instead of the newer :=. At least, I'd prefer a 2  
>> keypresses than 3 keypresses (shift, semicolon, equal) for  
>> entering the assignment operator.
>>
>> I propose the following:
>>
>> 1) Outside of the code display within Squeak, always use :=  
>> because the <- is not available anywhere else.
>>
>> 2) Inside Squeak, let it be a preference to allow the user to  
>> choose between := and <- for the glyph used to display the  
>> assignment operator.
>>
>> 3) Add Ctrl-= as an additional keybinding for entering the  
>> assignment operator. This way, there's a 2-keypress way for  
>> entering assignment again.
>>
>> Would it be a big performance hit if the source code is always  
>> stored using :=, and add a method to StringHolderView or  
>> PluggableTextView to convert from := to -> when displaying code?
>>
>> Duncan.
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

Duncan Mak-2
On 6/4/06, stéphane ducasse <[hidden email]> wrote:
I realized that the preference may not be what you suggest.
In that case propose an enh. Indeed this is important that all the
code is store using one convention.

With syntaxHighlightingAsYouTypeAnsiAssignment enabled, I can see that _ will get converted to :=.

In both OmniBrowser and Shout Workspace, this conversion only happens after having accepted the buffer (i.e. no more red border). It would be best if it could do it on the fly, without requiring the buffer be accepted.

For now, I'll work on adding a new keybinding to ParagraphEditor (ctrl-=) for entering := and submit a patch for that. Later, when everything's been converted to use :=, maybe then I can put together a package to alter only the rendering of := to the left-arrow.

Does that sound good?

Duncan.


Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

Chris Muller
In reply to this post by stéphane ducasse-2
Hi Stéphane,

> .. Indeed this is important that all the  
> code is store using one convention.

Why is it so important, can you enlighten me?

thanks..



Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

Schwab,Wilhelm K
In reply to this post by Duncan Mak-2
Chris,

================================
Hi Stéphane,

> .. Indeed this is important that all the
> code is store using one convention.

Why is it so important, can you enlighten me?

thanks..
================================

I'm with Stef on this.  It strikes me as being almost self-evident that one would want to be in synch with other Smalltalks with respect to syntax.  <somebodyHasToSayIt>While there is certainly nothing wrong w/ one-character assignment if users want it (which many obviously do), it was a mistake to put same into the compiler and to taint the sources with it.  It belongs in the editors, and should be optional.</somebodyHasToSayIt>

This is something that can be done in a way that serves both camps.

Bill



Wilhelm K. Schwab, Ph.D.
University of Florida
Department of Anesthesiology
PO Box 100254
Gainesville, FL 32610-0254

Email: [hidden email]
Tel: (352) 846-1285
FAX: (352) 392-7029


Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

stéphane ducasse-2
In reply to this post by Chris Muller

On 5 juin 06, at 19:01, Chris Muller wrote:

> Hi Stéphane,
>
>> .. Indeed this is important that all the
>> code is store using one convention.
>
> Why is it so important, can you enlighten me?

Did you try to understand Morphic code or any code that you did not  
wrote and that is more than
30 lines with conflicts?
Then you would like as much as possible not to have extra conflicts  
just because _ is used in one version and := in another.

But give a try because this can enlighten you...

Sorry to be violent but I'm fed up not of you but of harvesting and  
taking care of a system...
that so few people care about.
Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

tblanchard
In reply to this post by Duncan Mak-2
I would also suggest that the left arrow is off-putting to newbies.  There's no obvious key for it, and it causes a lot of confusion for the user trying to figure out how to make one.  So it ends up being a barrier to entry. Making ParagraphEditor "magically" replace things (or render them specially) isn't really better.   

I think it's time to let this convention go - it's more trouble than its worth.

-Todd Blanchard
 
On Jun 4, 2006, at 1:15 PM, Duncan Mak wrote:

On 6/4/06, stéphane ducasse <[hidden email]> wrote:
I realized that the preference may not be what you suggest.
In that case propose an enh. Indeed this is important that all the
code is store using one convention.

With syntaxHighlightingAsYouTypeAnsiAssignment enabled, I can see that _ will get converted to :=.

In both OmniBrowser and Shout Workspace, this conversion only happens after having accepted the buffer (i.e. no more red border). It would be best if it could do it on the fly, without requiring the buffer be accepted.

For now, I'll work on adding a new keybinding to ParagraphEditor (ctrl-=) for entering := and submit a patch for that. Later, when everything's been converted to use :=, maybe then I can put together a package to alter only the rendering of := to the left-arrow.

Does that sound good?

Duncan.




Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

John Pierce-2
On 6/7/06, Todd Blanchard <[hidden email]> wrote:
>
> I would also suggest that the left arrow is off-putting to newbies.  There's
> no obvious key for it, and it causes a lot of confusion for the user trying
> to figure out how to make one.  So it ends up being a barrier to entry.
> Making ParagraphEditor "magically" replace things (or render them specially)
> isn't really better.

Even worse, the tranditional assignment operator looks an aweful lot
like the figure that is silk screened on my "Backspace" key (at least
on my keyboard). ;-)

> I think it's time to let this convention go - it's more trouble than its
> worth.

With that said, I really *love* the single left arrow for assignment.
I am saddened by the trend to eject it, but I understand it might not
be the best for the long run.

I guess I can get used to := instead, but it just feels so "programmery".

Regards,

John

--
The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore, all
progress depends on the unreasonable man. -- George Bernard Shaw

Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

Chris Muller
In reply to this post by Schwab,Wilhelm K
> .. It strikes me as being almost self-evident
> that one would want to be in synch with other Smalltalks with respect
> to syntax.

Sorry, its not evident to me, can you be more explicit.  Every
left-arrow assignment I type these days has me all "worried" that I'm
creating some sort of unknown painful consequence for myself in the
future.

I'm trying to make myself believe its SO important that I retrain
myself to go BACK to := so that I will, in fact, bite the bullet and do
it.  Can you help me make the jump?

It's not important for porting to other Smalltalks, since a trivial
script can do the transformation.  I'm not too concerned about someone
getting confused by the code since it would be obvious very quickly
what it is..  

So far, all I'm coming up with is pretty much one of those "consistency
for consistency's sake" type of arguments..

Thanks..

Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

Chris Muller
In reply to this post by stéphane ducasse-2
> Did you try to understand Morphic code or any code that you did not  
> wrote and that is more than
> 30 lines with conflicts?
> Then you would like as much as possible not to have extra conflicts  
> just because _ is used in one version and := in another.

Oh yeah, I *have* been enlightened to that; not fun at all.  But I
attribute that pain to the preference
#syntaxHighlightingAsYouTypeAnsiAssignment being on by default.  The
sheer audacity of that preference being on by default is quite frankly
amazing to me.

Worse, our "solution" appears to be to extend the tyranny with
"required universal compliance".  We're actually gonna go back and
update original authors code with someones stylistic preference rather
than simply defaulting syntaxHighlightingAsYouTypeAnsiAssignment and
syntaxHighlightingAsYouTypeLeftArrowAssignment to false.  Sad.

Personally, I would never impose my own personal style on someone else.
 When someone makes changes to my code and sends it back to me, I would
never update it solely for style.  I appreciate and respect different
authors styles, and even recognize some added value over homogeny;
*cough* I mean "consistency".

I support your work and your+community's decisions, Stef.  I even
helped facilitate this movement toward forced compliance; since I
wanted to make sure we didn't also destroy the historical author/time
information in the process.

Now I'm just trying to figure out if I need to stop typing left-arrow..
what are the consequences for my disobedience..?

thanks..

Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

Andrew Tween
> Oh yeah, I *have* been enlightened to that; not fun at all.  But I
> attribute that pain to the preference
> #syntaxHighlightingAsYouTypeAnsiAssignment being on by default.  The
> sheer audacity of that preference being on by default is quite frankly
> amazing to me.

When Shout is installed, the value of #syntaxHighlightingAsYouTypeAnsiAssignment
is set to the current value of the #ansiAssignmentOperatorWhenPrettyPrinting
preference, and #syntaxHighlightingAsYouTypeLeftArrowAssignment is set to its
negation.

In hindsight, this was a mistake. It would have been better to default both
preferences to false, as you suggest. However, this was in no way an *audacious*
attempt to force ansi-assignments onto people, rather it was an attempt to
conform to the preferences that they had already set.

I will fix futures releases of Shout so that both preferences are off by
default, which should make things easier.
Cheers,
Andy

Reply | Threaded
Open this post in threaded view
|

Style script for new squeakfoundation.org wanted!

karl-8
In reply to this post by stéphane ducasse-2
With lots of help there is now a image with seaside/pier running to host
the
new www.squeakfoundation.org site.
www.squeak.org:7780/seaside/pier (for the time being)
But it needs a little style script tuning.
The foundation logo should be there somewhere etc.
Logo is here:
http://smallwiki.unibe.ch/squeakfoundation/squeakfoundationlogo/
I can't offer much more than  a big thank you and membership of the
Webteam for the winner.
Happy hacking

Karl


Reply | Threaded
Open this post in threaded view
|

Re: Style script for new squeakfoundation.org wanted!

Klaus D. Witzel
Hi Karl,

I can imagine but I also can't imagine that the award you set out is for  
the first who is able to hack the password (or equivalent) for getting  
write access for adding style to that site?

/Klaus

On Thu, 08 Jun 2006 08:52:22 +0200, karl wrote:

> With lots of help there is now a image with seaside/pier running to host  
> the
> new www.squeakfoundation.org site.
> www.squeak.org:7780/seaside/pier (for the time being)
> But it needs a little style script tuning.
> The foundation logo should be there somewhere etc.
> Logo is here:  
> http://smallwiki.unibe.ch/squeakfoundation/squeakfoundationlogo/
> I can't offer much more than  a big thank you and membership of the  
> Webteam for the winner.
> Happy hacking
>
> Karl
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

Schwab,Wilhelm K
In reply to this post by Duncan Mak-2
Chris,

==========================
> .. It strikes me as being almost self-evident
> that one would want to be in synch with other Smalltalks with respect
> to syntax.

Sorry, its not evident to me, can you be more explicit. Every
left-arrow assignment I type these days has me all "worried" that I'm
creating some sort of unknown painful consequence for myself in the
future.

I'm trying to make myself believe its SO important that I retrain
myself to go BACK to := so that I will, in fact, bite the bullet and do
it. Can you help me make the jump?

It's not important for porting to other Smalltalks, since a trivial
script can do the transformation. I'm not too concerned about someone
getting confused by the code since it would be obvious very quickly
what it is..

So far, all I'm coming up with is pretty much one of those "consistency
for consistency's sake" type of arguments..
==========================

I do not see it that way at all.  Squeak's handling/abuse of underscores
has been a pain to me for a long time, and I am apparently not alone.
Please note that I am proposing a solution that would let you type _ for
assignment.  However, I am convinced that it was a mistake to allow what
should be an editor macro to get built into the compiler and tarnish the
sources.

Bill




Wilhelm K. Schwab, Ph.D.
University of Florida
Department of Anesthesiology
PO Box 100254
Gainesville, FL 32610-0254

Email: [hidden email]
Tel: (352) 846-1285
FAX: (352) 392-7029


Reply | Threaded
Open this post in threaded view
|

Re: Style script for new squeakfoundation.org wanted!

karl-8
In reply to this post by Klaus D. Witzel
Klaus D. Witzel skrev:
> Hi Karl,
>
> I can imagine but I also can't imagine that the award you set out is
> for the first who is able to hack the password (or equivalent) for
> getting write access for adding style to that site?
>
> /Klaus
Maybe I was a little unclear. What the site needs is a style script.
The platform is Pier. Make style script changes and show me a screenshot
or a site where the script is in use. Then I will put it in use for
the squeakfoundation site.

karl

>
> On Thu, 08 Jun 2006 08:52:22 +0200, karl wrote:
>
>> With lots of help there is now a image with seaside/pier running to
>> host the
>> new www.squeakfoundation.org site.
>> www.squeak.org:7780/seaside/pier (for the time being)
>> But it needs a little style script tuning.
>> The foundation logo should be there somewhere etc.
>> Logo is here:
>> http://smallwiki.unibe.ch/squeakfoundation/squeakfoundationlogo/
>> I can't offer much more than  a big thank you and membership of the
>> Webteam for the winner.
>> Happy hacking
>>
>> Karl
>>
>>
>>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

Ralph Johnson
In reply to this post by Schwab,Wilhelm K
On 6/8/06, Bill Schwab <[hidden email]> wrote:

> I do not see it that way at all.  Squeak's handling/abuse of underscores
> has been a pain to me for a long time, and I am apparently not alone.
> Please note that I am proposing a solution that would let you type _ for
> assignment.  However, I am convinced that it was a mistake to allow what
> should be an editor macro to get built into the compiler and tarnish the
> sources.

You didn't answer his question.  He wanted to know why it was a pain.
He already knew that someone thought it was a pain.  He argued that it
was not a pain because you could easily convert from one form to
another, and he wanted to know why his argument was wrong.

A simple conversion program will mess up programs that use underscore
for other purposes, such as in a string.  So, sometimes conversion
works fine and sometimes (not very often) it doesn't.  A proper
converter would have to parse the program (or at least scan it) to
only convert underscores used for assignment.  In any case, what if
you are working in another Smalltalk and want to file in some Squeak
code that was never converted?  You have to write your own converter,
and use of underscores often trip people up a little.  It is possible
to get around it, but people who go back and forth between different
Smalltalks  get tired of it after awhile.

Originally ALL Smalltalks used underscore (left arrow) as assignment.
Smalltalk V was the first to use := instead, I think.  VisualAge did
it.  VisualWorks converted about 1990, and I can't remember whether it
came first or VisualAge.  For awhile, a lot of VisualWorks code did it
both ways, but eventually it all got converted to := and I must admit
I was happy to find when I started Squeak to find that it still used
the old left arrow.

The reason people gave for using := instead of left arrow was that it
was easier to display on ASCII (i.e. non-bitmapped) printers and
terminals.  Those things ar relics of history now, thougn the relics
live on in things like keyboards and e-mail.  There is no easy way for
me to include a left-arrow in this message, since I am typing it on
gmail.  The ANSI standard now uses := and all the other Smalltalk's
use it so Squeak should use it, too, even though I think that for
pedagogical reasons, left arrow is better.  For those who do not know
programming, its meaning is more obvious.  For those who do, it is one
more sign that "you are not in Kansas anymore".  The use of an equal
sign for assignment is really stupid and one of the arbitrary and
unintuitive communication choices that programmers have made.  := is a
little better, but not much.  Left arrow makes it obvious that a value
is moving from the right to the left.

-Ralph Johnson

Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

Edgar J. De Cleene
Ralph Johnson puso en su mail :

> Originally ALL Smalltalks used underscore (left arrow) as assignment.
> Smalltalk V was the first to use := instead, I think.  VisualAge did
> it.  VisualWorks converted about 1990, and I can't remember whether it
> came first or VisualAge.  For awhile, a lot of VisualWorks code did it
> both ways, but eventually it all got converted to := and I must admit
> I was happy to find when I started Squeak to find that it still used
> the old left arrow.

Ralph:
All the post is very instructive.

I wonder why not use <- , two characters as := , but closer to original
idea.


Edgar



               
_________________________________________________________
Horóscopos, Salud y belleza, Chistes, Consejos de amor:
el contenido más divertido para tu celular está en Yahoo! Móvil.
Obtenelo en http://movil.yahoo.com.ar

Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

Gilrandir
This discussion isn't here for the first time, and i can only repeat
myself:
*yes*, the "pascalish" ":=" assignment is ANSI and it should be used as
default for all the out-of-the-image things,
*yes* "left-arrow" *is* nice,
*but* we really need underscore as a standalone ascii character (for
example, i'm using underscores in a *lot* of directory names).
I don't really see a real reason why the "<-" aka
"ascii-compliant-left-arrow" possibility (though more "describing" than
":=" ) gets ignored everytime...

Lic. Edgar J. De Cleene napsal(a):

> Ralph Johnson puso en su mail :
>
>> Originally ALL Smalltalks used underscore (left arrow) as assignment.
>> Smalltalk V was the first to use := instead, I think.  VisualAge did
>> it.  VisualWorks converted about 1990, and I can't remember whether it
>> came first or VisualAge.  For awhile, a lot of VisualWorks code did it
>> both ways, but eventually it all got converted to := and I must admit
>> I was happy to find when I started Squeak to find that it still used
>> the old left arrow.
>
> Ralph:
> All the post is very instructive.
>
> I wonder why not use <- , two characters as := , but closer to original
> idea.
>
>
> Edgar
>
>
>
>
> _________________________________________________________
> Horóscopos, Salud y belleza, Chistes, Consejos de amor:
> el contenido más divertido para tu celular está en Yahoo! Móvil.
> Obtenelo en http://movil.yahoo.com.ar
>
>



Reply | Threaded
Open this post in threaded view
|

Re: The assignment character in 3.9 and onward

Klaus D. Witzel
In reply to this post by Edgar J. De Cleene
On Thu, 08 Jun 2006 13:33:55 +0200, Lic. Edgar J. De Cleene wrote:
>
> I wonder why not use <- , two characters as := , but closer to original
> idea.

+(1 big)

/Klaus

> Edgar


12