Re: deleting delete and exist need not exist

2013-02-11 Thread Nicholas Clark
On Mon, Feb 11, 2013 at 08:11:53AM -0600, Patrick R. Michaud wrote: > On Mon, Feb 11, 2013 at 09:56:31AM +, Nicholas Clark wrote: > > Here are a better set of patches for Rakudo. They don't duplicate the check > > for $p < 0, and they avoid calling nqp::elems(), by assuming that > > nqp::atpos

Re: deleting delete and exist need not exist

2013-02-11 Thread Patrick R. Michaud
On Mon, Feb 11, 2013 at 09:56:31AM +, Nicholas Clark wrote: > Here are a better set of patches for Rakudo. They don't duplicate the check > for $p < 0, and they avoid calling nqp::elems(), by assuming that nqp::atpos() > safely return nql::null() for indices beyond the end of the array. > (Whic

Re: deleting delete and exist need not exist

2013-02-11 Thread Nicholas Clark
Here are a better set of patches for Rakudo. They don't duplicate the check for $p < 0, and they avoid calling nqp::elems(), by assuming that nqp::atpos() safely return nql::null() for indices beyond the end of the array. (Which Parrot does. Is any of this spec'd anywhere?) The NQP patches remain

deleting delete and exist need not exist

2013-02-10 Thread Nicholas Clark
Following discussion on #perl6 yesterday: http://irclog.perlgeek.de/perl6/2013-02-09#i_6433552 We figured that 1) Rakudo's delete for Arrays is, um, completely lacking in awesome 2) it's possible to eliminate two NQP ops, deletepos and existspos deletepos "should" be used, but isn't, for dele