Permalink
Browse files

Give NQPList a .new method.

  • Loading branch information...
1 parent 98e707b commit 7e36dac774aa030d4bbcd8345ad5ed9868da97bf @jnthn committed Oct 18, 2010
Showing with 12 additions and 0 deletions.
  1. +12 −0 common/NQP/NQPSetting.pm
View
@@ -66,6 +66,9 @@ knowhow NQPNum is repr('P6num') {
}
knowhow NQPList is repr('P6list') {
+ method new() {
+ nqp::instance_of(self.WHAT)
+ }
method elems() {
nqp::lllist_elems(self)
}
@@ -75,6 +78,15 @@ knowhow NQPList is repr('P6list') {
}
knowhow NQPArray is repr('P6list') {
+ method new() {
+ nqp::instance_of(self.WHAT)
+ }
+ method elems() {
+ nqp::lllist_elems(self)
+ }
+ method at_pos($idx) {
+ nqp::lllist_get_at_pos(self, $idx.Int)
+ }
}
# This is a little bit of a cheat. We only really need to keep

0 comments on commit 7e36dac

Please sign in to comment.