From: Ilmari Heikkinen Date: 2005-02-14T01:36:55+09:00 Subject: Re: Object#to_ruby and Object#to_c Hi, On 8.2.2005, at 19:52, Ben Giddings wrote: > In case you missed it, on RedHanded, I spotted was an interesting > snippet I didn't see on the list or anything: > > It's a way of using ParseTree and RubyToC to add 'to_c' and 'to_ruby' > methods to any Method. > > http://redhanded.hobix.com/cult/tooInterestingToPassUp.html I hacked some on the original RubyToRuby class of Ryan Davis. Now it parses most of ruby syntax, including itself. http://dark.fhtr.org/ruby2ruby.rb There's a test unit at the bottom of the file to demonstrate the capability Interesting thoughts arose: 1. docstrings would be quite trivial to implement with parsetree 2. one could write ruby-lisp that eats parsetree, and translate it to ruby and vice versa -Ilmari