On Sun, 13 Mar 2005, Tom Willis wrote:

> Anyway, I want to know what other kind of cool,i guess I'll call it
> metaprogramming, can be done in ruby.

Here's a previously-unreleased edition of RubyX11:

  http://artengine.ca/matju/RubyX11/RubyX11-0.6.pre1.tar.gz

Compared to the better-known version 0.5, this one replaces the
type-declaration interpreter, by a type-declaration _compiler_. The output
of the compiler is eval'ed at load time.

This is an unfinished project. I wrote the compiler in Oct.2001.

Because RubyX11 makes a clean separation between interface descriptions
and the actual task of encoding/decoding, this "client library" could also
be useful in writing a X11 _server_ in Ruby, as well as other things.

> For example, I remember reading something about Eiffel having the
> ability to declare pre and post conditions for method calls on
> objects, essentially bringing this criteria in as part of the
> interface. Can something like this be done in Ruby?

Ruby's backtracking method-lookup allows a nice kludge for imitating
pre/post conditions, as can be seen in MetaRuby (_my_ MetaRuby project,
not the other one). Also, Andrew Hunt had something much closer to
Eiffel's way, but using a preprocessor (?). And also a more generic
solution is AspectR, which implements LISP-style method-combinations
(:before/:after/:around/etc) and possibly a few other things (i don't
recall which).

_____________________________________________________________________
Mathieu Bouchard -=- Montr?al QC Canada -=- http://artengine.ca/matju