On Tue, 19 Oct 2004 22:33:57 +0900, Bil Kleb <bil.kleb / nasa.gov> wrote: > Eivind Eklund wrote: > > > > Richard: Why do you prefer Nathaniel's syntax over Florian's? > > Can someone compare/contrast an example of each for the same scenario? Sure. From a practical use of Florian's code (his sample from Regexp::English): # Creates a Regexp which matches a literal string. In this # string any special regular expression meta-characters will # be escaped automatically. # # # This creates a Regexp which will match 3 "foo"s. # re = Regexp::English.literal("foo" * 3) # re.match("foofoofoo")[0] # => "foofoofoo" def literal(text); Node::Literal.new(text); end Translated to Nathaniel's syntax: # Creates a Regexp which matches a literal string. In this # string any special regular expression meta-characters will # be escaped automatically. example do # This creates a Regexp which will match 3 "foo"s. re = Regexp::English.literal("foo" * 3) assert_equal("foofoofoo", re.match("foofoofoo")[0]) end def literal(text); Node::Literal.new(text); end Note that this will also presently break rdoc, though there is an intention of later adding rdoc support. To avoid breaking with rdoc presently, you'd need to move the example BEFORE the comment. Eivind. -- Hazzle free packages for Ruby? RPA is available from http://www.rubyarchive.org/