Skip to content

Instantly share code, notes, and snippets.

@kboga
Created February 24, 2013 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kboga/b1227868756278af6d7c to your computer and use it in GitHub Desktop.
Save kboga/b1227868756278af6d7c to your computer and use it in GitHub Desktop.
knowhow ops patch
diff --git a/src/NQP/Grammar.pm b/src/NQP/Grammar.pm
index 75016d0..91b776d 100644
--- a/src/NQP/Grammar.pm
+++ b/src/NQP/Grammar.pm
@@ -11,8 +11,8 @@ grammar NQP::Grammar is HLL::Grammar {
# one universal KnowHOW from the 6model core, and an attribute
# meta-object to go with it.
my %*HOW;
- %*HOW<knowhow> := pir::get_knowhow__P();
- %*HOW<knowhow-attr> := pir::get_knowhow_attribute__P();
+ %*HOW<knowhow> := nqp::knowhow();
+ %*HOW<knowhow-attr> := nqp::knowhowattr();
# Serialization context builder - keeps track of objects that
# cross the compile-time/run-time boundary that are associated
diff --git a/t/nqp/60-bigint.t b/t/nqp/60-bigint.t
index 2a4f96b..ce5ca97 100644
--- a/t/nqp/60-bigint.t
+++ b/t/nqp/60-bigint.t
@@ -3,7 +3,7 @@ use nqpmo;
plan(36);
-my $knowhow := pir::get_knowhow__P();
+my $knowhow := nqp::knowhow();
my $bi_type := $knowhow.new_type(:name('TestBigInt'), :repr('P6bigint'));
$bi_type.HOW.compose($bi_type);
sub str($x) { nqp::tostr_I($x) };
diff --git a/t/serialization/02-types.t b/t/serialization/02-types.t
index d288d4e..091899e 100644
--- a/t/serialization/02-types.t
+++ b/t/serialization/02-types.t
@@ -15,7 +15,7 @@ sub add_to_sc($sc, $idx, $obj) {
my $sc := nqp::createsc('TEST_SC_1_IN');
my $sh := nqp::list_s();
- my $type := pir::get_knowhow__P().new_type(:name('Badger'), :repr('P6int'));
+ my $type := nqp::knowhow().new_type(:name('Badger'), :repr('P6int'));
$type.HOW.compose($type);
add_to_sc($sc, 0, $type);
add_to_sc($sc, 1, nqp::box_i(42, $type));
@@ -39,8 +39,8 @@ sub add_to_sc($sc, $idx, $obj) {
my $sc := nqp::createsc('TEST_SC_2_IN');
my $sh := nqp::list_s();
- my $type := pir::get_knowhow__P().new_type(:name('Dugong'), :repr('P6opaque'));
- $type.HOW.add_attribute($type, pir::get_knowhow_attribute__P().new(name => '$!home'));
+ my $type := nqp::knowhow().new_type(:name('Dugong'), :repr('P6opaque'));
+ $type.HOW.add_attribute($type, nqp::knowhowattr().new(name => '$!home'));
$type.HOW.compose($type);
add_to_sc($sc, 0, $type);
diff --git a/t/serialization/03-closures.t b/t/serialization/03-closures.t
index a8ee2d4..39381a3 100644
--- a/t/serialization/03-closures.t
+++ b/t/serialization/03-closures.t
@@ -22,7 +22,7 @@ sub add_to_sc($sc, $idx, $obj) {
# Here we make a clone of it, which is what we're testing.
my $m2 := nqp::clone($m1);
- my $type := pir::get_knowhow__P().new_type(:name('SimpleCloneTest'), :repr('P6opaque'));
+ my $type := nqp::knowhow().new_type(:name('SimpleCloneTest'), :repr('P6opaque'));
$type.HOW.add_method($type, 'original', $m1);
$type.HOW.add_method($type, 'cloned', $m2);
$type.HOW.compose($type);
@@ -64,12 +64,12 @@ sub add_to_sc($sc, $idx, $obj) {
nqp::scsetcode($sc, 1, $raw_meth);
pir::setprop__vPsP($raw_meth, 'STATIC_CODE_REF', $raw_meth);
- my $type1 := pir::get_knowhow__P().new_type(:name('RoleLikeTest1'), :repr('P6opaque'));
+ my $type1 := nqp::knowhow().new_type(:name('RoleLikeTest1'), :repr('P6opaque'));
$type1.HOW.add_method($type1, 'm', $m1);
$type1.HOW.compose($type1);
add_to_sc($sc, 0, $type1);
- my $type2 := pir::get_knowhow__P().new_type(:name('RoleLikeTest2'), :repr('P6opaque'));
+ my $type2 := nqp::knowhow().new_type(:name('RoleLikeTest2'), :repr('P6opaque'));
$type2.HOW.add_method($type2, 'm', $m2);
$type2.HOW.compose($type2);
add_to_sc($sc, 1, $type2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment