From: Robert Klemme Date: 2003-08-01T16:47:52+09:00 Subject: Re: Ruby haiku (senryu?) "Martin DeMello" schrieb im Newsbeitrag news:7IaWa.26369$LD6.211975@news0.telusplanet.net... > Rudolf Polzer wrote: > > > OK, now define what a syllable is. A token (including |, ; and others)? A > > keyword or identifier? A keyword or identifier's syllable? Or even a > > token's syllable: ; = se-mi-co-lon [probably not, I don't know English > > hyphenation]? se-mi-ko-ro-n [oops, virtually no ; allowed in the first > > or third line *g*]? > > Okay, here's a go at it, trying to keep line breaks as clean as possible > > # steps through an array > # yielding only elements > # with non-nil values "false" is excluded, too. > class Array > def filled > each do |x| # "each do x" > next unless x > yield x > end > end > end > > Still flawed in that the natural idiom is "yield x if x" but it's a > start. This is fun! Robert