[svn:parrot] r47014 - trunk/src/pmc

pmichaud at svn.parrot.org pmichaud at svn.parrot.org
Wed May 26 05:42:07 UTC 2010


Author: pmichaud
Date: Wed May 26 05:42:07 2010
New Revision: 47014
URL: https://trac.parrot.org/parrot/changeset/47014

Log:
[core]:  Add .set_outer_ctx method to Sub PMC
to explicitly set outer_ctx of next invocation (for
times when the outer_sub doesn't have the needed context).

Modified:
   trunk/src/pmc/sub.pmc

Modified: trunk/src/pmc/sub.pmc
==============================================================================
--- trunk/src/pmc/sub.pmc	Wed May 26 05:38:21 2010	(r47013)
+++ trunk/src/pmc/sub.pmc	Wed May 26 05:42:07 2010	(r47014)
@@ -954,6 +954,10 @@
 
 Sets the sub that is the outer of this one.
 
+=item C<void set_outer_ctx(PMC *outer_ctx)>
+
+Set the outer context to be used on the next invocation of this sub.
+
 =item C<INTVAL arity()>
 
 Returns the arity of the Sub (the number of arguments, excluding optional and
@@ -1091,6 +1095,13 @@
     }
 
 
+    METHOD set_outer_ctx(PMC *outer_ctx) {
+        Parrot_Sub_attributes *sub;
+        PMC_get_sub(INTERP, SELF, sub);
+        sub->outer_ctx = outer_ctx;
+    }
+
+
     METHOD get_multisig() {
         PMC                   *multisig;
         Parrot_Sub_attributes *sub;


More information about the parrot-commits mailing list