Support for continuations in Eclipse
Migrated from http://lampsvn.epfl.ch/trac/scala/ticket/3184
Reporter mblevins
It would be nice if there was a convenient way to use the continuations plugin from within Eclipse. The client library is included in the scala library now (for 2.8), but there are still obstacles. I suggest:
1) Include the compiler plugin "continuations.jar" within the eclipse plugin.
2) Provide an easy (checkbox?) method to enable it. Currently, a command-line compiler parameter is required, which is not specifiable when using the eclipse plugin. See http://permalink.gmane.org/gmane.comp.lang.scala/19439
Reporter mblevins
It would be nice if there was a convenient way to use the continuations plugin from within Eclipse. The client library is included in the scala library now (for 2.8), but there are still obstacles. I suggest:
1) Include the compiler plugin "continuations.jar" within the eclipse plugin.
2) Provide an easy (checkbox?) method to enable it. Currently, a command-line compiler parameter is required, which is not specifiable when using the eclipse plugin. See http://permalink.gmane.org/gmane.comp.lang.scala/19439
Leave a comment
on 2010-03-19 15:43 *
By
(In [21221]) Added support for Int and multi-string compiler switches (elideLevel, Yrecursion, plugin, disable, require, pluginOptions); some cleanup of compiler settings dialog (still pretty gross unfortunately); added support for continuations plugins (set 'P' setting to "continuations:enable"). Fixes #3184.
on 2010-03-19 15:44 *
By tracImporter
Closed As: fixed
OK, I set P to "continuations:enable", but the following code fragment generates an error
"not found: value reset"
Is there something I need to import? Also, I don't see continuations.jar in the libraries. Where do I find this?
reset {
println(1)
shift { (cont: Unit => Unit) =>
cont()
cont()
println(2)
}
println(3)
}
"not found: value reset"
Is there something I need to import? Also, I don't see continuations.jar in the libraries. Where do I find this?
on 2010-06-19 17:24 *
By
Please feel free to add useful content like this to the wiki ... it's more likely to be found there than buried in a close ticket.
OK, now I get the following error
Here is my application
Do I need a the continuations.jar file, and where do I get it?
hello world
1
Exception in thread "main" java.lang.NoSuchMethodError: scala.util.continuations.package$.shift(Lscala/Function1;)Ljava/lang/Object;
at HelloWorld$$anonfun$main$1.apply$mcV$sp(HelloWorld.scala:10)
at HelloWorld$$anonfun$main$1.apply(HelloWorld.scala:8)
at HelloWorld$$anonfun$main$1.apply(HelloWorld.scala:8)
at scala.util.continuations.package$.reset(package.scala:20)
at HelloWorld$.main(HelloWorld.scala:8)
at HelloWorld.main(HelloWorld.scala)
Here is my application
object HelloWorld {
import scala.util.continuations._
def main(args : Array[String]) : Unit = {
println("hello world")
reset {
println(1)
shift { (cont: Unit => Unit) =>
cont()
cont()
println(2)
}
println(3)
}
}
}
Do I need a the continuations.jar file, and where do I get it?
on 2010-06-21 17:50 *
By
Are you running that from the command line or via an Eclipse launch?
It worked all the time, now using http://download.scala-ide.org/update-current-35 the option does not work anymore!!
"bad option: -P:continuations:enable"
Please fix this ASAP, it worked all the time!
"bad option: -P:continuations:enable"
Please fix this ASAP, it worked all the time!
OK, now I am using http://download.scala-ide.org/nightly-update-helios-2.8.0.final under Eclipse 3.6.1
-P:continuations:enable still does not work (it hoses everything), and if it is not set I still get
Continuation Test
Exception in thread "main" java.lang.NoSuchMethodError: scala.util.continuations.package$.shift(Lscala/Function1;)Ljava/lang/Object;
at Continue$.foo$1(Continue.scala:10)
at Continue$.bar$1(Continue.scala:13)
at Continue$$anonfun$baz$1$1.apply$mcI$sp(Continue.scala:16)
at Continue$$anonfun$baz$1$1.apply(Continue.scala:16)
at Continue$$anonfun$baz$1$1.apply(Continue.scala:16)
at scala.util.continuations.package$.reset(package.scala:20)
at Continue$.baz$1(Continue.scala:16)
at Continue$.main(Continue.scala:18)
at Continue.main(Continue.scala)Once here.
Hmmm, I don't see a very bright future for continuations in Eclipse if people cannot make even the most simple examples work.
-P:continuations:enable still does not work (it hoses everything), and if it is not set I still get
Continuation Test
Exception in thread "main" java.lang.NoSuchMethodError: scala.util.continuations.package$.shift(Lscala/Function1;)Ljava/lang/Object;
at Continue$.foo$1(Continue.scala:10)
at Continue$.bar$1(Continue.scala:13)
at Continue$$anonfun$baz$1$1.apply$mcI$sp(Continue.scala:16)
at Continue$$anonfun$baz$1$1.apply(Continue.scala:16)
at Continue$$anonfun$baz$1$1.apply(Continue.scala:16)
at scala.util.continuations.package$.reset(package.scala:20)
at Continue$.baz$1(Continue.scala:16)
at Continue$.main(Continue.scala:18)
at Continue.main(Continue.scala)Once here.
Hmmm, I don't see a very bright future for continuations in Eclipse if people cannot make even the most simple examples work.
Updating tickets (#1000069, #1000195, #1000213, #1000223, #1000006, #1000021, #1000038, #1000048, #1000051, #1000052, #1000075, #1000103, #1000109, #1000115, #1000119, #1000156, #1000186, #1000207, #1000238, #1000262, #1000263, #380, #389, #683, #1238, #1331, #1635, #1645, #1715, #1729, #1744, #1783, #1839, #1869, #1885, #1890, #1902, #1918, #1919, #1924, #1925, #1946, #1964, #1991, #2131, #2233, #2342, #2348, #2408, #2459, #2499, #2523, #2572, #2582, #2602, #2614, #2615, #2675, #2710, #2745, #2763, #2816, #2830, #2834, #2878, #2879, #2887, #2888, #2901, #2911, #2912, #2922, #2937, #2938, #2942, #2951, #2955, #2957, #2961, #2964, #2965, #2974, #2975, #2989, #2990, #3002, #3055, #3070, #3087, #3135, #3139, #3173, #3182, #3184, #3200, #3213, #3214, #3221, #3243, #3251)