[#6363] Re: rescue clause affecting IO loop behavior — ts <decoux@...>

>>>>> "D" == David Alan Black <dblack@candle.superlink.net> writes:

17 messages 2000/11/14
[#6367] Re: rescue clause affecting IO loop behavior — David Alan Black <dblack@...> 2000/11/14

Hello again --

[#6582] best way to interleaf arrays? — David Alan Black <dblack@...>

Hello --

15 messages 2000/11/26

[#6646] RE: Array Intersect (&) question — Aleksi Niemel<aleksi.niemela@...>

Ross asked something about widely known and largely ignored language (on

23 messages 2000/11/29
[#6652] RE: Array Intersect (&) question — rpmohn@... (Ross Mohn) 2000/11/29

aleksi.niemela@cinnober.com (Aleksi Niemel) wrote in

[#6723] Re: Array Intersect (&) question — Mathieu Bouchard <matju@...> 2000/12/01

> >Use a hash. Here's code to do both and more. It assumes that

[#6656] printing/accessing arrays and hashes — raja@... (Raja S.)

I'm coming to Ruby with a Python & Common Lisp background.

24 messages 2000/11/30

[ruby-talk:6403] Re: Array.fill with block?

From: Hugh Sasse Staff Elec Eng <hgs@...>
Date: 2000-11-16 18:47:26 UTC
List: ruby-talk #6403
On Fri, 17 Nov 2000, Yukihiro Matsumoto wrote:

> Hi,
> 
> In message "[ruby-talk:6401] Array.fill with block?"
>     on 00/11/17, Hugh Sasse Staff Elec Eng <hgs@dmu.ac.uk> writes:
> |
> |Does anyone else think that it might be a good idea for Array.fill to take
> |a block to compute the value for each successive element?  I'm thinking
> |that it might be faster/more efficient than Array.collect! because it need
> |not pass in the value each time. It could pass in the index number,
> |perhaps.
> 
> You mean that Array#fill with a block should be faster since it
> doesn't have to retrieve the element?  I don't think so.  Retrieving
> an array element in this case costs only a few machine instructions
> for each element, I believe.

For large arrays it adds up...  Well, I just wondered if it was worth
considering, and because it would be a bit more orthoganal -- lots
of iterators can take blocks, but Array.fill doesn't.  I was a bit
surprised.  I can live with collect! though.  
> 
> 							matz.
> 
> 
	Hugh



In This Thread

Prev Next