Splat, #to_ary and #to_a

Heading right for it :slight_smile:
Thx
Robert

ยทยทยท

On 9/18/06, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

Hi,

In message "Re: Splat, #to_ary and #to_a" > on Mon, 18 Sep 2006 17:54:32 +0900, "Robert Dober" < > robert.dober@gmail.com> writes:

>Is 1.9.0 good enough?, because I get
>>
>ruby1.9 -ve 'p [*"foo\nbar"]'
>-->ruby 1.9.0 (2006-04-21) [i486-linux]

When we talk about 1.9, the date matters. And we encourage to try the
most recent version from CVS HEAD. It's 2006-09-18 today.

                                                        matz.

--
Deux choses sont infinies : l'univers et la bรชtise humaine ; en ce qui
concerne l'univers, je n'en ai pas acquis la certitude absolue.

- Albert Einstein

Thanks, I guess I'm going to have to find the time to install 1.9.

Those darn clients take up too much time with their problems! And in
this case it's problems with a big wad o'php I just inherited. A sorry
mess which is a prime candidate for takeover by assimilation by ruby
code, once I understand enough of what it's supposed to do.

ยทยทยท

On 9/19/06, MonkeeSage <MonkeeSage@gmail.com> wrote:

$ ruby19 -v && ruby19 -e "p (1..10).to_a.values_at(3..5)"
ruby 1.9.0 (2006-09-19) [i686-linux]
[4, 5, 6]

Regards,
Jordan

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Just for posterity, it may be worth pointing what Eero hinted at. If
you add a to_ary method to Range / String in 1.9, then you get the old
behavior for the use cases that show differences (e.g., [*(1..10)] ):

class Range
ย ย def to_ary
ย ย ย ย self.inject([]) { |ary, item| ary << item }
ย ย end
end

Regards,
Jordan

Hi,

ยทยทยท

In message "Re: Splat, #to_ary and #to_a" on Tue, 19 Sep 2006 01:36:22 +0900, "J2M" <james2mccarthy@gmail.com> writes:

When we talk about 1.9, the date matters. And we encourage to try the
most recent version from CVS HEAD. It's 2006-09-18 today.

So does this mean that Why's excellent talk at RailsConf Europe is
already out of date?

I don't know. I haven't had a luck to hear his "excellent talk" yet.
Could anybody elaborate?

              matz.

Rick DeNatale wrote:

Those darn clients take up too much time with their problems! And in
this case it's problems with a big wad o'php I just inherited. A sorry
mess which is a prime candidate for takeover by assimilation by ruby
code, once I understand enough of what it's supposed to do.

"Resistance is futile; we will take your knowledge and add it to the
collective. You will be assimilated" hehe! :wink:

Regards,
Jordan

Yes, I somehow missed the TITLE of this thread!

ยทยทยท

On 9/19/06, MonkeeSage <MonkeeSage@gmail.com> wrote:

Just for posterity, it may be worth pointing what Eero hinted at. If
you add a to_ary method to Range / String in 1.9, then you get the old
behavior for the use cases that show differences (e.g., [*(1..10)] ):

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/