Skip to content

Instantly share code, notes, and snippets.

Created June 26, 2011 17:37
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 anonymous/1047788 to your computer and use it in GitHub Desktop.
Save anonymous/1047788 to your computer and use it in GitHub Desktop.
diff --git a/src/Perl6/Metamodel/BOOTSTRAP.pm b/src/Perl6/Metamodel/BOOTSTRAP.pm
index 63816eb..0531e87 100644
--- a/src/Perl6/Metamodel/BOOTSTRAP.pm
+++ b/src/Perl6/Metamodel/BOOTSTRAP.pm
@@ -413,6 +413,14 @@ Num.HOW.add_attribute(Num, BOOTSTRAPATTR.new(:name<$!value>, :type(num), :box_ta
# Stash these common types for box ops.
pir::perl6_set_types_ins__vPPP(Int, Num, Str);
+# class Parcel is Cool {
+# has $!storage;
+# ...
+# }
+my stub Parcel metaclass Perl6::Metamodel::ClassHOW { ... };
+Parcel.HOW.add_parent(Parcel, Cool);
+Parcel.HOW.add_attribute(Parcel, scalar_attr('$!storage', Mu));
+
# class Iterable is Cool {
# ...
# }
@@ -576,6 +584,7 @@ my module EXPORT {
$?PACKAGE.WHO<Real> := Real;
$?PACKAGE.WHO<Int> := Int;
$?PACKAGE.WHO<Num> := Num;
+ $?PACKAGE.WHO<Parcel> := Parcel;
$?PACKAGE.WHO<Iterable> := Iterable;
$?PACKAGE.WHO<Iterator> := Iterator;
$?PACKAGE.WHO<ListIter> := ListIter;
diff --git a/src/core/Parcel.pm b/src/core/Parcel.pm
index 210110c..c218162 100644
--- a/src/core/Parcel.pm
+++ b/src/core/Parcel.pm
@@ -1,5 +1,7 @@
my class Parcel does Positional {
- has $!storage; # RPA of Parcel's elements
+ # declared in BOOTSTRAP.pm:
+ # is Cool; # parent class
+ # has $!storage; # RPA of Parcel's elements
method flat() {
nqp::p6list(pir::clone__PP($!storage), List, 1.Bool)
diff --git a/tools/build/Makefile.in b/tools/build/Makefile.in
index 7137694..8e23103 100644
--- a/tools/build/Makefile.in
+++ b/tools/build/Makefile.in
@@ -127,7 +127,6 @@ CORE_SOURCES = \
src/core/Any.pm \
src/core/Code.pm \
src/core/Attribute.pm \
- src/core/Parcel.pm \
src/core/Cool.pm \
src/core/Bool.pm \
src/core/Numeric.pm \
@@ -136,6 +135,7 @@ CORE_SOURCES = \
src/core/Num.pm \
src/core/Stringy.pm \
src/core/Str.pm \
+ src/core/Parcel.pm \
src/core/Iterable.pm \
src/core/Iterator.pm \
src/core/Nil.pm \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment