Created
April 1, 2017 12:02
-
-
Save lizmat/5f5bdb529a46d8c037d06e6093249251 to your computer and use it in GitHub Desktop.
Making set() a sentinel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Perl6/Actions.nqp b/src/Perl6/Actions.nqp | |
index b2e60a1..d4e2b92 100644 | |
--- a/src/Perl6/Actions.nqp | |
+++ b/src/Perl6/Actions.nqp | |
@@ -5544,8 +5544,12 @@ class Perl6::Actions is HLL::Actions does STDActions { | |
make QAST::Op.new( :op('call'), :name('&term:<time>'), :node($/) ); | |
} | |
+ my $empty_set; | |
method term:sym<empty_set>($/) { | |
- make QAST::Op.new( :op('call'), :name('&set'), :node($/) ); | |
+ unless $empty_set { | |
+ $empty_set := nqp::create($*W.find_symbol(['Set'])); | |
+ } | |
+ make QAST::WVal.new( :value($empty_set) ); | |
} | |
method term:sym<rand>($/) { | |
================= | |
$ 6 'use nqp; dd nqp::objectid(∅); dd nqp::objectid(∅)' | |
===SORRY!=== | |
Object of type Set in QAST::WVal, but not in SC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment