Permalink
Browse files

Code.static_id which ignores closure cloning

  • Loading branch information...
1 parent 4b92201 commit 84e6cbc1e6fc9f27d58f0c273660ce708186ed0f @moritz moritz committed Feb 11, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core/Code.pm
View
@@ -14,4 +14,10 @@ my class Code does Callable {
method outer(Code:D:) {
pir::perl6_code_object_from_parrot_sub__PP($!do.get_outer())
}
+
+ # returns an identifier for this code object
+ # that is the same even for cloned closures
+ method static_id(Code:D:) {
+ nqp::p6box_i(nqp::where($!do.get_lexinfo));
+ }
}

0 comments on commit 84e6cbc

Please sign in to comment.