From: surrender_it@... (gabriele renzi @ google) Date: 2004-08-05T19:11:28+09:00 Subject: Re: Macros in Ruby > def_with_docstring(Object, "foo", "returns arg", "arg", "arg") > > Object.new.foo("hi") # => "hi" > > Yes, I am aware you can do more sophisticated implementation so you > can make the above nicer. Yet, as nice as it will be, it won't be as > simple as the example with macro; there will be quirkiness caused by > the language syntax. not that much, did you see the MetaTags system or the various implementations of docstrings? Something on the lines of: doc 'this things does foo' def foo ... end is quite trivial to do. > For example, rake has this in its documentation: "NOTE: Because of a > quirk in Ruby syntax, parenthesis are required on rule when the first > argument is a regular expression." IIRC this is related to bison not being good enough :)