From: dblack@... Date: 2003-05-30T07:21:48+09:00 Subject: Re: Iteration - last detection Hi -- On Fri, 30 May 2003, Martin DeMello wrote: > dblack@superlink.net wrote: > > Let Ruby do more of the work for you :-) > > > > module Enumerable > > def each_with_last > > each_with_index {|e,i| yield(e, i == size-1)} > > end > > end > > You aren't guaranteed 'size', though. Yikes. So much for conciseness :-) Thanks for the timely correction. David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav