On Sun, 20 Jul 2003 00:10:25 +0900
Brian Candler <B.Candler / pobox.com> wrote:

> On Sat, Jul 19, 2003 at 11:23:04PM +0900, Pit Capitain wrote:
> > I'm not Dave Thomas :-) but you can also use inject here:
> > 
> > module Enumerable
> >   def ordered?
> >     inject { | last, item | return false unless last < item; item }
> >     true
> >   end
> > end
> 
> Which implementation of 'inject' are you using? The one in PragProg requires
> an initial value to be passed as a parameter.

The inject in 1.8 defaults its initial value to the first item in the collection.

Jason Creighton