converting arrow to ':=' for assignment in squeak 3.9

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

converting arrow to ':=' for assignment in squeak 3.9

Ralph Boland
I am currently converting my squeak project from Squeak 3.8 to Squeak 3.9.
(Thanks by the way to the people who helped me installSqueak 3.9 in Linux.
Note that commands  'man squeak'  and  'man inisqueak'
still reports the existence of a  command 'inisqueak'
even though the command is not to be found.)

My understanding was that as of 3.9  Squeak no longer supports use of the arrow
for the assignment operator and that I must use ':='.  :-(
I thus expected that all my arrows would be converted to  ':=' upon fileIn.
But this doesn't happen.  Upon investigation I found the the arrow operator
still in use in the 3.9 code though it is now displayed as an underscore (which
after all is what is is).

Can someone explain to me clearly the  status of the underscore
character for Squeak 3.9 and beyond?

Can someone explain to me how to convert my underscores to  ':=' or
must I write a sed script to do this?

Note that I will use the arrow until I am forced to convert to ':='.

Thanks

Ralph Boland

P.S.  I am running Squeak3.9  on Ubuntu 6.10 Linux on a PC.






Reply | Threaded
Open this post in threaded view
|

Re: converting arrow to ':=' for assignment in squeak 3.9

Philippe Marschall
2007/4/30, Ralph Boland <[hidden email]>:

> I am currently converting my squeak project from Squeak 3.8 to Squeak 3.9.
> (Thanks by the way to the people who helped me installSqueak 3.9 in Linux.
> Note that commands  'man squeak'  and  'man inisqueak'
> still reports the existence of a  command 'inisqueak'
> even though the command is not to be found.)
>
> My understanding was that as of 3.9  Squeak no longer supports use of the
> arrow
> for the assignment operator and that I must use ':='.  :-(
> I thus expected that all my arrows would be converted to  ':=' upon fileIn.
> But this doesn't happen.  Upon investigation I found the the arrow operator
> still in use in the 3.9 code though it is now displayed as an underscore
> (which
> after all is what is is).
>
> Can someone explain to me clearly the  status of the underscore
> character for Squeak 3.9 and beyond?
>
> Can someone explain to me how to convert my underscores to  ':=' or
> must I write a sed script to do this?
>
> Note that I will use the arrow until I am forced to convert to ':='.

Squeak 3.9 still supports _ for assignments, it just prints it as _
and not as an arrow (which confuses almost every newbie).

Automatic _ to := is not that simple, not every _ is an assignment and
there are some live methods, which you can not just change. There is a
script for this which handles most cases.

Cheers
Philippe

> Thanks
>
> Ralph Boland
>
> P.S.  I am running Squeak3.9  on Ubuntu 6.10 Linux on a PC.
>
>
>
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

RE: converting arrow to ':=' for assignment in squeak 3.9

michaelperscheid
Hi ---,

the simplest solution is
1. Open preference browser
2. Search for ':='
3. Switch the Button from syntaxHighligthingAsYouTypeLeftArrowAssignment to
syntaxHighligthingAsYouTypeAnsiAssignment

Regards,
Michael

> -----Ursprüngliche Nachricht-----
> Von: [hidden email] [mailto:squeak-dev-
> [hidden email]] Im Auftrag von Philippe Marschall
> Gesendet: Montag, 30. April 2007 22:36
> An: The general-purpose Squeak developers list
> Betreff: Re: converting arrow to ':=' for assignment in squeak 3.9
>
> 2007/4/30, Ralph Boland <[hidden email]>:
> > I am currently converting my squeak project from Squeak 3.8 to Squeak
> 3.9.
> > (Thanks by the way to the people who helped me installSqueak 3.9 in
> Linux.
> > Note that commands  'man squeak'  and  'man inisqueak'
> > still reports the existence of a  command 'inisqueak'
> > even though the command is not to be found.)
> >
> > My understanding was that as of 3.9  Squeak no longer supports use of
> the
> > arrow
> > for the assignment operator and that I must use ':='.  :-(
> > I thus expected that all my arrows would be converted to  ':=' upon
> fileIn.
> > But this doesn't happen.  Upon investigation I found the the arrow
> operator
> > still in use in the 3.9 code though it is now displayed as an underscore
> > (which
> > after all is what is is).
> >
> > Can someone explain to me clearly the  status of the underscore
> > character for Squeak 3.9 and beyond?
> >
> > Can someone explain to me how to convert my underscores to  ':=' or
> > must I write a sed script to do this?
> >
> > Note that I will use the arrow until I am forced to convert to ':='.
>
> Squeak 3.9 still supports _ for assignments, it just prints it as _
> and not as an arrow (which confuses almost every newbie).
>
> Automatic _ to := is not that simple, not every _ is an assignment and
> there are some live methods, which you can not just change. There is a
> script for this which handles most cases.
>
> Cheers
> Philippe
>
> > Thanks
> >
> > Ralph Boland
> >
> > P.S.  I am running Squeak3.9  on Ubuntu 6.10 Linux on a PC.
> >
> >
> >
> >
> >
> >
> >
> >


Reply | Threaded
Open this post in threaded view
|

Re: converting arrow to ':=' for assignment in squeak 3.9

Lukas Renggli
In reply to this post by Philippe Marschall
What I did for Magritte, Pier, Seaside, Scriptaculous and many other
packages was:

      FixUnderscores fixPackage: 'Magritte'

This fixes all the assignments automatically and opens up an editor on
methods that couldn't be automatically fixed. It is a matter of
minutes to even clean up huge projects.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: converting arrow to ':=' for assignment in squeak 3.9

Duncan Mak-2
I wanted to post a changeset, but I couldn't figure out how to do it.

Here's a snippet of code for TextMorph>>keyStroke: that makes it insert ':=' when you press Cmd-dash. It's working for on Linux.

    (evt keyCharacter = $- and: [Sensor commandKeyPressed])
        ifTrue:
            [editor
                zapSelectionWith: ' := ';
                unselect].

This method is listed under the category "*ecompletion-override", is that the reason why the change is not going to my new ChangeSet?

--
Duncan.