backticked identifiers in string interpolation

47 views
Skip to first unread message

Kevin Wright

unread,
Jul 27, 2015, 9:46:11 AM7/27/15
to scala-internals

The recent SLIP meeting noted some concerns with my SIP proposal for making string interpolation more consistent.
That said, the concerns all seemed to be around comments on the PR regarding the "enhanced" variant I originally described.

I've therefore removed that section and cleaned up the document to make the intent clearer:


Feedback would be much appreciated!

Johannes Rudolph

unread,
Jul 27, 2015, 10:44:05 AM7/27/15
to scala-i...@googlegroups.com
On Mon, Jul 27, 2015 at 3:46 PM, Kevin Wright <kev.lee...@gmail.com> wrote:
> The recent SLIP meeting noted some concerns with my SIP proposal for making
> string interpolation more consistent.

Are results of these meetings somewhere on record?

Johannes

Som Snytt

unread,
Jul 27, 2015, 12:45:24 PM7/27/15
to scala-internals
For summaries, I suppose we must wait for the next Scalawags.



--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Seth Tisue

unread,
Jul 27, 2015, 1:05:00 PM7/27/15
to scala-internals, johannes...@googlemail.com, johannes...@googlemail.com
On Monday, July 27, 2015 at 10:44:05 AM UTC-4, Johannes Rudolph wrote:
Are results of these meetings somewhere on record? 

Johannes Rudolph

unread,
Jul 27, 2015, 1:41:02 PM7/27/15
to Seth Tisue, scala-internals
Thanks!
--
Johannes

-----------------------------------------------
Johannes Rudolph
http://virtual-void.net

Som Snytt

unread,
Jul 27, 2015, 2:22:43 PM7/27/15
to scala-internals
I added a pre- and post-test to my PR for that, as Jason had suggested -- BTW the hiccup is that a negative test cannot see both parser and typer errors.

In the slip meeting, Martin is negative about the change, but recall that Martin was negative about interpolation in the first place, though he came around.

Well, Martin says alphanumeric idents are simple, though people want things like underscores in there.

It turns out that in 2015, underscores are still alnums. This goes to the case that I only want one notion of identifier (or three or four: backquoted, operators, variables and stable ids; in German, nouns begin with uppercase, das Id or rather das Es).

Don't make me remember what counts as an id in a string interpolation context.

trait X {

  val x  = 42
  val y_ = 17

  val `a..z` = ('a' to 'z').toList

  val x$y = 3

  def `fails but x_ is not alnum`    = s"$x_"   // not emitted b/c not a parse error

  def `compiles but y_ is not alnum` = s"$y_"

  def `brace yourselves`             = s"ABCs: $`a..z`"

  def `embedded dollars`             = s"<$`x$y`"

  def `one style of embedded quote`  = s"$"Don't quote me on that!$" he objected."

  //def `SI-6476 Popular style quote`= s"\"Don't quote me on that!\" he objected."
}



--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
Reply all
Reply to author
Forward
0 new messages