> From: Zach Dennis [mailto:zdennis / mktec.com] 
> Sent: Friday, 5 November 2004 14:01
> Subject: Re: Cleaner way to do this?

> If your friend knows the processing he wants to do on the first >
element, why not just keep it simple...

> arr = [1,2,3,4,5]
> process = proc{ |e| print e }.call( arr[0] )
> arr[1...arr.length].each do |e|
>     print ", #{e}"
> end

Agreed :-).

I think the original discussion came about because he was interested in
iterators and wanted to understand how one might write an efficient
iterator that allowed for handling of special cases, like doing
something different with the first or last entry in a collection.

I didn't like to dampen that kind of enthusiasm.

H.


************************************************************************

If you have received this e-mail in error, please delete it and notify the sender as soon as possible. The contents of this e-mail may be confidential and the unauthorized use, copying, or dissemination of it and any attachments to it, is prohibited. 

Internet communications are not secure and Hyperion does not, therefore, accept legal responsibility for the contents of this message nor for any damage caused by viruses.  The views expressed here do not necessarily represent those of Hyperion.

For more information about Hyperion, please visit our Web site at www.hyperion.com