Strange behaviour of """strings""" in :power mode of scala REPL 2.10.0

78 views
Skip to first unread message

Bjorn Regnell

unread,
Jan 6, 2013, 11:45:09 AM1/6/13
to scala...@googlegroups.com
Found this problem - any work-arounds?
---
>scala
Welcome to Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_02).
Type in expressions to have them evaluated.
Type :help for more information.

scala> """abc"""
res0: String = abc

scala> :power
** Power User mode enabled - BEEP WHIR GYVE **
** :phase has been set to 'typer'.          **
** scala.tools.nsc._ has been imported      **
** global._, definitions._ also imported    **
** Try  :help, :vals, power.<tab>           **

scala> """abc"""
<console>:5: error: ';' expected but string literal found.
  def $line  = """"""abc"""""";
                     ^
scala>

Paul Phillips

unread,
Jan 6, 2013, 12:04:02 PM1/6/13
to scala...@googlegroups.com


On Sun, Jan 6, 2013 at 8:45 AM, Bjorn Regnell <bjorn....@cs.lth.se> wrote:
Found this problem - any work-arounds?

Oh quoting, you'll outlive us all.

Workaround will be don't use triple quoted strings. Power mode isn't exactly an object of first-class support; it might be for the best that there are quirks like this because you wouldn't want to start banking on its implementation details. It's a hacker tool only.

Daniel Sobral

unread,
Jan 6, 2013, 12:29:53 PM1/6/13
to scala...@googlegroups.com
I get the feeling it might be possible to get around the problem with
string interpolation, but maybe it's just lack of sugar in my blood.
:-)


--
Daniel C. Sobral

I travel to the future all the time.

Seth Tisue

unread,
Jan 6, 2013, 12:36:55 PM1/6/13
to scala...@googlegroups.com
On Sun, Jan 6, 2013 at 11:45 AM, Bjorn Regnell <bjorn....@cs.lth.se> wrote:
> ** Power User mode enabled - BEEP WHIR GYVE **

gyve and gvmble?

--
Seth Tisue | Northwestern University | http://tisue.net
developer, NetLogo: http://ccl.northwestern.edu/netlogo/
Reply all
Reply to author
Forward
0 new messages