From 7e36dac774aa030d4bbcd8345ad5ed9868da97bf Mon Sep 17 00:00:00 2001 From: Jonathan Worthington Date: Mon, 18 Oct 2010 23:39:13 +0200 Subject: [PATCH] Give NQPList a .new method. --- common/NQP/NQPSetting.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/NQP/NQPSetting.pm b/common/NQP/NQPSetting.pm index a0eb95c..3ec15c6 100644 --- a/common/NQP/NQPSetting.pm +++ b/common/NQP/NQPSetting.pm @@ -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