-
Notifications
You must be signed in to change notification settings - Fork 21
REPL cheats me #6623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6623?orig=1 |
@paulp said: |
@som-snytt said: scala> $intp.isettings
res0: scala.tools.nsc.interpreter.ISettings =
ISettings {
deprecation = false
maxAutoprintCompletion = 250
maxPrintString = 800
unwrapStrings = true
}
scala> $intp.isettings.unwrapStrings = false
$intp.isettings.unwrapStrings: Boolean = false The recent simplification of the javap command leaves it un-unwrapped. That is, true names are shown. |
Use a conventional import to bump context depth in REPL templates. Code is still ordinarily wrapped in a `$read` object. This is a step toward scala/bug#6623-like transparency. - retronym takes the blame for this innovation; - adriaanm collaborated in its commission; - som-snytt batted clean-up.
The repl imports scala.tools.nsc.interpreter.{{ to bump the context depth in REPL templates, instead of wrapping subsequent input in deeper `$iw` objects. Code is still ordinarily wrapped in a `$read` object. This is a step toward transparency of the repl encoding (see scala/bug#6623). - retronym takes the blame for this innovation. - adriaanm collaborated in its commission. - som-snytt batted clean-up. Other changes: - $read is special cased by typer; not a good idea to make it a property - hide INSTANCE (class-based wrapping) from type toString by renaming it to include the `$read` name
The repl imports scala.tools.nsc.interpreter.{{ to bump the context depth in REPL templates, instead of wrapping subsequent input in deeper `$iw` objects. Code is still ordinarily wrapped in a `$read` object. This is a step toward transparency of the repl encoding (see scala/bug#6623). - retronym takes the blame for this innovation. - adriaanm collaborated in its commission. - som-snytt batted clean-up. Other changes: - $read is special cased by typer; not a good idea to make it a property - hide INSTANCE (class-based wrapping) from type toString by renaming it to include the `$read` name
The repl imports scala.tools.nsc.interpreter.{{ to bump the context depth in REPL templates, instead of wrapping subsequent input in deeper `$iw` objects. Code is still ordinarily wrapped in a `$read` object. This is a step toward transparency of the repl encoding (see scala/bug#6623). - retronym takes the blame for this innovation. - adriaanm collaborated in its commission. - som-snytt batted clean-up. Other changes: - $read is special cased by typer; not a good idea to make it a property - hide INSTANCE (class-based wrapping) from type toString by renaming it to include the `$read` name
The repl imports scala.tools.nsc.interpreter.{{ to bump the context depth in REPL templates, instead of wrapping subsequent input in deeper `$iw` objects. Code is still ordinarily wrapped in a `$read` object. This is a step toward transparency of the repl encoding (see scala/bug#6623). - retronym takes the blame for this innovation. - adriaanm collaborated in its commission. - som-snytt batted clean-up. Other changes: - $read is special cased by typer; not a good idea to make it a property - hide INSTANCE (class-based wrapping) from type toString by renaming it to include the `$read` name
The repl imports scala.tools.nsc.interpreter.{{ to bump the context depth in REPL templates, instead of wrapping subsequent input in deeper `$iw` objects. Code is still ordinarily wrapped in a `$read` object. This is a step toward transparency of the repl encoding (see scala/bug#6623). - retronym takes the blame for this innovation. - adriaanm collaborated in its commission. - som-snytt batted clean-up. Other changes: - $read is special cased by typer; not a good idea to make it a property - hide INSTANCE (class-based wrapping) from type toString by renaming it to include the `$read` name
The repl imports scala.tools.nsc.interpreter.{{ to bump the context depth in REPL templates, instead of wrapping subsequent input in deeper `$iw` objects. Code is still ordinarily wrapped in a `$read` object. This is a step toward transparency of the repl encoding (see scala/bug#6623). - retronym takes the blame for this innovation. - adriaanm collaborated in its commission. - som-snytt batted clean-up. Other changes: - $read is special cased by typer; not a good idea to make it a property - hide INSTANCE (class-based wrapping) from type toString by renaming it to include the `$read` name
Forward port at scala/scala#8600 Backward at scala/scala#8576 Closing as merged to 2.12 with momentum for 2.13 in the new year. |
I note for the record that this is only fixed under a non-default setting (namely I'm tempted to change the issue title to something more informative, but after all these years I've grown attached to the original title. |
actually, is it even fixed at all? am I missing something?
|
@SethTisue you need a lightbend subscription to get the sbt ScalaOptionParser support. |
Maybe it's fairer to not call this one fixed. The "magic" import option gets rid of the increased nesting, but we still nest things and try to pretend we don't. |
Actually instead of filtering all output, the feedback output should echo the user input (not showing wrapping). Wrapping should be visible otherwise, in Also turning it off was made harder instead of easier in 2.13. |
hehe, I suppose I should have mentioned that I had to add the flag to ScalaOptionParser to even try that (I didn't want to admit I was too lazy to go on and PR it) |
Today, I spend much time to find out why my reflection code does not work in REPL. And finally, I am sure that I had been cheated by REPL:
I consider replacing
$line3.$read$$iw$$iw$$iw$
trick as a bug, because it breaks reflect likeclass Foo; Class.forName("Foo")
and make people confused.I highly recommend to remove this trick.
The text was updated successfully, but these errors were encountered: