Aureliano Calvo schrieb:
> Now I see that if I can transform all the <"a#{expression}c"> in <"a"
> + (expression) + "c"> in a ruby source code string, I could change
> expression with "a#{expression}c" in "a" + clever_stuff(expression) +
> "c" and use my changed + method in Strings. Is there an easy way to
> manipulate ruby code in ruby to do this?

Aureliano, is it right that you don't need to manipulate the code at 
runtime, and you can work with the source code instead? This can be more 
or less hard to do, depending on the complexity of the expressions which 
are allowed inside the strings. For simple expressions a regex solution 
might be enough. Otherwise you'd need to use one of the Ruby parser 
libraries.

If this is for a research project, then maybe you could patch the Ruby 
interpreter to add the hook you need. This shouldn't be too difficult.

Regards,
Pit