Use the P4 preprocessor on your scripts :P You'll get #define EXACTLY.

No, but seriously - text substitute macros are awful. There's a good
reason that Matz didn't offer them in Ruby.

If you want real macros, there's a sort of a way to do it with
ParseTree, but it's kind of complicated AFAIK (never tried).

Tell us what you want to do and we'll probably find a way to do it
without the awful #define.


Aur


Check http://rubymentor.rubyforge.org/

On 3/11/07, Michael Strelnikov <michaelst / gmail.com> wrote:
> Hello all,
>
>    Does Ruby have something like "#define" for C/C++? Especially with
> arguments like "#define foo(x) (something_done_with_x(x))".
>
>    Please don't say that "def" do the same. It doesn't.
>
> Thanks,
> Michael
>