This page is no longer maintained — Please continue to the home page at www.scala-lang.org

'symbols break most editors

6 replies
Alexy Khrabrov
Joined: 2009-05-25,
User offline. Last seen 42 years 45 weeks ago.
I'd love to use 'symbols for interned string-liek constants.  However, TextMate flips everything to string after what it thinks is the opening '.I have to carefully watch it and terminate the line with //', if needed.  I have yet to see a non-Emacs editor to understand symbols. Anybody with a TextMate fix for it?  Why don't we change it to :symbols in 2.8 or some other non-pairing prefix?  :)
Cheers,Alexy
nilskp
Joined: 2009-01-30,
User offline. Last seen 1 year 27 weeks ago.
Re: 'symbols break most editors
On Mon, Sep 21, 2009 at 8:02 PM, Alexy Khrabrov <deliverable@gmail.com> wrote:
I'd love to use 'symbols for interned string-liek constants.  However, TextMate flips everything to string after what it thinks is the opening '.I have to carefully watch it and terminate the line with //', if needed.  I have yet to see a non-Emacs editor to understand symbols. Anybody with a TextMate fix for it?  Why don't we change it to :symbols in 2.8 or some other non-pairing prefix?  :)

I've asked for the special syntax to be deprecated, or preferably compiler inlined. As it works today, every time you use the special syntax, a lock is acquired, a map lookup performed using a String key, and then either the map value is returned or a new Symbol is constructed. Every single time. So you better not use it for faster comparison, because it is in fact slower.
Alexy Khrabrov
Joined: 2009-05-25,
User offline. Last seen 42 years 45 weeks ago.
Re: 'symbols break most editors
On Mon, Sep 21, 2009 at 9:19 PM, Nils Kilden-Pedersen <nilskp@gmail.com> wrote:
... So you better not use it for faster comparison, because it is in fact slower.

Nils -- so it confirms my hunch that using "just" strings is easier than symbols!  Text editors will be happy and speed will improve...  So much for 'em 'eymbols.  (Now am compulsively matching open-close quotes.)
Cheers,Alexy
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: 'symbols break most editors

On Mon, Sep 21, 2009 at 09:02:16PM -0400, Alexy Khrabrov wrote:
> I'd love to use 'symbols for interned string-liek constants. However,
> TextMate flips everything to string after what it thinks is the
> opening '.I have to carefully watch it and terminate the line with
> //', if needed. I have yet to see a non-Emacs editor to understand
> symbols. Anybody with a TextMate fix for it? Why don't we change it
> to :symbols in 2.8 or some other non-pairing prefix? :)

I became sufficiently annoyed with the single quote thing to learn the
textmate bundle syntax well enough to fix that and a few other things.
What I didn't learn is how exactly those changes are stored and what the
simplest way to give them to someone else is. Everything you need looks
to be in the file I found here:

Library/Application Support/TextMate/Bundles/Scala.tmbundle/Syntaxes/Scala.tmDelta

A copy of which I have placed at:

http://www.improving.org/scala/Scala.tmDelta

...but no tech support beyond that, that's everything I know.

Alexy Khrabrov
Joined: 2009-05-25,
User offline. Last seen 42 years 45 weeks ago.
Re: 'symbols break most editors

On Mon, Sep 21, 2009 at 9:35 PM, Paul Phillips wrote:
> Everything you need looks to be in the file I found here:
>
> Library/Application Support/TextMate/Bundles/Scala.tmbundle/Syntaxes/Scala.tmDelta
>
> A copy of which I have placed at:
>
>  http://www.improving.org/scala/Scala.tmDelta
>
> ...but no tech support beyond that, that's everything I know.

Paul -- awesome. Which original Scala bundle do you use? Last time I
touched those bundles was when I grabbed your megabundle off github
and anointed the first one as Library/Application
Support/TextMate/Bundles/Scala.tmbundle. Did you add the
Scala.tmDelta to that one?

[Since then, some new things appeared, such as
http://smallcultfollowing.com/nikolog/2009/06/06/new-scala-textmate-bundle/,
but they, as well as some from that megabundle, don't work for me.
Macromates doesn't list the official Scala bundle among
http://svn.textmate.org/trunk/Bundles/.]

Cheers,
Alexy

Ken Bloom
Joined: 2009-09-22,
User offline. Last seen 42 years 45 weeks ago.
Re: 'symbols break most editors

On Mon, 21 Sep 2009 21:02:16 -0400, Alexy Khrabrov wrote:

> bols for interned string-liek constants. However, TextMate flips
> everything to string after what it thinks is the opening '.I have to
> carefully watch it and terminate the line with //', if needed.
> I have yet to see a non-Emacs editor to understand symbols. Anybody
> with
> a TextMate fix for it? Why don't we change it to :symbols in 2.8 or
> some other non-pairing prefix? :)
>
> Cheers,

Vim with the syntax highlighting files from http://
lorenzod8n.wordpress.com/2008/01/11/getting-scala-syntax-hightlighting-to-
work-in-vim/ works just fine. I think you need to write some TextMate
syntax highlighting files. It should be able to handle them.

(TextMate can handle LISP, can't it? LISP does exactly the same thing
with quotes.)

dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: 'symbols break most editors
Here's a reasonable good jEdit 4.3 (beta) Scala edit mode. It handles symbols and chars correctly. What I couldn't teach it to is to recognize Scala identifiers. It doesn't have a rule for that, and the break chars stuff it uses isn't powerful enough (Scala would require a negative look-behind to handle break chars properly).

On Mon, Sep 21, 2009 at 10:02 PM, Alexy Khrabrov <deliverable@gmail.com> wrote:
I'd love to use 'symbols for interned string-liek constants.  However, TextMate flips everything to string after what it thinks is the opening '. I have to carefully watch it and terminate the line with //', if needed.  I have yet to see a non-Emacs editor to understand symbols. Anybody with a TextMate fix for it?  Why don't we change it to :symbols in 2.8 or some other non-pairing prefix?  :)
Cheers, Alexy



--
Daniel C. Sobral

Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland