We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Welcome to Scala version 2.10.0.r25463-b20110808085525 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26). scala> :power ** Power User mode enabled - BEEP BOOP SPIZ ** scala> :paste // Entering paste mode (ctrl-D to finish) def time[T](fn: => T): (T, Double) = { val start = System.nanoTime (fn, (System.nanoTime - start) / 1.0E9) } ^D // Exiting paste mode, now interpreting. time: [T](fn: => T)(T, Double) scala> :wrap time Set wrapper to 'time' scala> (1 to 1000000).sum
no error, no result, nothing. by contrast in 2.9.0.1 the same thing gives me a compile error:
<console>:6: error: type mismatch; found : (java.lang.String, Double) required: String val $export: String = `time` { ^
taking the hint and going back to trunk with a changed definition of "time":
Welcome to Scala version 2.10.0.r25463-b20110808085525 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26). scala> :paste // Entering paste mode (ctrl-D to finish) def time[T](fn: => T): T = { val start = System.nanoTime val result = fn println((System.nanoTime - start) / 1.0E9) result } ^D // Exiting paste mode, now interpreting. time: [T](fn: => T)T scala> :power ** Power User mode enabled - BEEP BOOP SPIZ ** scala> :wrap time Set wrapper to 'time' scala> time(3) 5.04E-4 4.35E-4 4.96E-4 4.97E-4 6.0E-6 0.001007 res0: Int = 3
now it's running my code over and over again. in 2.9 it works:
scala> time(3) 3.6E-5 res0: Int = 3
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-4896?orig=1 Reporter: @SethTisue See #7747
Sorry, something went wrong.
@som-snytt said: The wrap command was removed from 2.10. The current idiom is:
scala> :pa // Entering paste mode (ctrl-D to finish) def timed(x: => String): String = { val start = System.nanoTime val res = x f"${((System.nanoTime - start) / 1.0E9).toInt}%d: $res" } // Exiting paste mode, now interpreting. timed: (x: => String)String scala> $intp.setExecutionWrapper($intp.global.exitingTyper($intp.symbolOfTerm("timed").fullName)) scala> 42 0: res1: Int = 42 scala> Thread sleep 5000L ; "Hello, timer." 5: res2: String = Hello, timer.
@som-snytt said: Relates to custom templating of embedded snippets.
No branches or pull requests
no error, no result, nothing. by contrast in 2.9.0.1 the same thing gives me a compile error:
taking the hint and going back to trunk with a changed definition of "time":
now it's running my code over and over again. in 2.9 it works:
The text was updated successfully, but these errors were encountered: