Daniel Schierbeck wrote: > William James wrote: > > Daniel Schierbeck wrote: > >> William James wrote: > >>> Daniel Schierbeck wrote: > >>>> Why haven't I thought of this before? > >>>> > >>>> class Terminal > >>>> include Enumerable > >>>> > >>>> def each(&block) > >>>> while input = gets > >>>> block.call(input.chomp) > >>>> end > >>>> end > >>> def each > >>> while input = gets > >>> yield input.chomp > >>> end > >>> end > >> Thanks! Yes, that's of course a whole lot faster. > >> > >> > >> Cheers, > >> Daniel > > > > I didn't know that it would be faster; I only knew that using &block > > is SO MUCH UGLIER! > > That, my friend, is a matter of taste. Some have good taste. Some have very bad taste; they relish a turd more than a chocolate bar or enjoy needlessly using &block.