[#3006] CVS repository — "Eugene Scripnik" <hoaz@...>

Hello.

21 messages 2004/06/16
[#3008] Re: CVS repository — ts <decoux@...> 2004/06/16

>>>>> "E" == Eugene Scripnik <hoaz@gala.net> writes:

[#3009] Re: CVS repository — Michal Rokos <michal@...> 2004/06/16

Hi!

[#3057] Ruby 1.8.2 to be released. — matz@... (Yukihiro Matsumoto)

Hi,

20 messages 2004/06/23

Re: [Patch] Array#shift(n)

From: nobu.nokada@...
Date: 2004-06-15 03:58:30 UTC
List: ruby-core #2998
Hi,

At Tue, 15 Jun 2004 00:14:05 +0900,
Michal Rokos wrote in [ruby-core:02991]:
> > |> |I think so.  #first and #last may be possible to use
> > |> |ary_make_shared() too?
> > |>
> > |> Accepted, along with pop(n).  You can submit the patch to the
> > |> HEAD, nobu.
> > |
> > |/me have commit account as well. :)
> >
> > Oh, you have already updated your account.  OK, you can do it by
> > yourself, if you implement the version that uses ary_make_shared().
> 
> I'll leave it up to nobu. (I'll have a look on some other things to 
> cleanup)

Another issue, with your patch, #first and #last return Array
instance always, but #shift will return an instance of the
original class.

  $ ./miniruby -e 'class A<Array;end; a = A[1,2,3]; p a.first(2).class'
  Array
  $ ./miniruby -e 'class A<Array;end; a = A[1,2,3]; p a.shift(2).class'
  A

I guess this should be consistent.

-- 
Nobu Nakada

In This Thread