Permalink
Browse files

[common] NQPArray.bind_pos plus some missing coercion methods.

  • Loading branch information...
1 parent 704d03a commit ebb368a97b2e1db261bccb08147a15839195163a @jnthn committed Oct 19, 2010
Showing with 9 additions and 0 deletions.
  1. +9 −0 common/NQP/NQPSetting.pm
View
@@ -6,6 +6,12 @@ knowhow NQPStr is repr('P6str') {
nqp::logical_not_int(nqp::equal_strs(self, "")) &&
nqp::logical_not_int(nqp::equal_strs(self, "0"))
}
+ method Int() {
+ nqp::coerce_str_to_int(self, NQPInt)
+ }
+ method Num() {
+ nqp::coerce_str_to_num(self, NQPNum)
+ }
method Numeric() {
nqp::coerce_str_to_num(self, NQPNum)
}
@@ -93,6 +99,9 @@ knowhow NQPArray is repr('P6list') {
method at_pos($idx) {
nqp::lllist_get_at_pos(self, $idx.Int)
}
+ method bind_pos($idx, $value) {
+ nqp::lllist_bind_at_pos(self, $idx.Int, $value)
+ }
}
# This is a little bit of a cheat. We only really need to keep

0 comments on commit ebb368a

Please sign in to comment.