summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2012-01-02 19:10:41 +0100
committerPaul Phillips <paulp@improving.org>2012-01-02 13:49:28 -0800
commitbeb875187914b12b1b9dbb5621447067e2926c7c (patch)
tree0021b5e8da609e8a9a18b191aec925b8835c8bf4 /src/library
parent3ad66eb5a3335b29c9d5e56b17155e030aeb7243 (diff)
downloadscala-beb875187914b12b1b9dbb5621447067e2926c7c.tar.gz
scala-beb875187914b12b1b9dbb5621447067e2926c7c.tar.bz2
scala-beb875187914b12b1b9dbb5621447067e2926c7c.zip
Changed boxing of free mutable variables to be flexible wrt when liftcode takes place.
A major redesign that unifies the various different approaches to boxing of free variables. Free variables are marked with CAPTURED and eliminated by LambdaLift. I also added some hooks in MacroContext that a reifier needs to use.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/reflect/api/MacroContext.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/library/scala/reflect/api/MacroContext.scala b/src/library/scala/reflect/api/MacroContext.scala
new file mode 100644
index 0000000000..e23357d26e
--- /dev/null
+++ b/src/library/scala/reflect/api/MacroContext.scala
@@ -0,0 +1,15 @@
+package scala.reflect
+package api
+
+trait MacroContext extends Universe {
+
+ /** Mark a variable as captured; i.e. force boxing in a *Ref type.
+ */
+ def captureVariable(vble: Symbol): Unit
+
+ /** Mark given identifier as a reference to a captured variable itself
+ * suppressing dereferencing with the `elem` field.
+ */
+ def referenceCapturedVariable(id: Ident): Tree
+
+} \ No newline at end of file