Forum: Ruby rubymacros 0.1.2 Released

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ab870531383eea6e4d9110317f5401e7?d=identicon&s=25 Caleb Clausen (Guest)
on 2009-05-01 19:06
(Received via mailing list)
RubyMacros version 0.1.2 has been released!

* <http://rubymacros.rubyforge.org/>
* <http://rubyforge.org/projects/rubymacros/>

RubyMacros is a lisp-like macro pre-processor for Ruby. More than just a
purely textual substitution scheme, RubyMacros can manipulate and morph
Ruby parse trees (in the form of RedParse Nodes) at parse time in just
about
any way you see fit.

Macros are programmed in ruby itself. And since parse trees are
represented
in RedParse format, they're easier to use (programatically) and more
object-
oriented than other available ruby parsetree formats. (RedParse Node
format
is actually designed to be straightforward to use and to represent the
structure of ruby source code very closely.)

Changes:
### 0.1.2 / 2009-04-26
* 7 minor enhancements
  * lots of nice comments added, thanks to Paul Brannan and Tatsuji
Kawai
  * Paul fixed the weird rdoc failure too!
  * incorrect warning removed
  * Value changed to Expr in parse rules
  * hack to get 'rake test' to stay in 1 process (to keep netbeans
happy)
  * in test_form.rb, don't test deep_copy on nil forms
  * all files should be world-readable now

== Benefits:
 * Powerful and easy metaprogramming
 * Create better DSLs
 * Manipulate syntax trees to suit yourself
 * Access local variables and other caller context unavailable to
methods
 * Macros as inline methods: should be slightly faster than equivalent
methods

== Drawbacks:
Although in theory already as powerful as lisp macros, the current
implementation has a number of problems which added together make it
merely
a proof of concept or toy at this point:
 * pre-processing is very, very slow (because of RedParse)
 * macro calls must be inside some sort of method;
 * straight out macro calls at the top level won't work
 * macros can't have blocks or receivers
 * some ruby syntax is unsupported in files using macros
 * files using macros must be loaded via Macro.require;
 * Kernel#require will not recognize macros
 * RedParse Node tree format will be changing slightly
 * macros cannot be scoped
 * no variable (or other) hygiene

* <http://rubymacros.rubyforge.org/>
* <http://rubyforge.org/projects/rubymacros/>
This topic is locked and can not be replied to.