From: Robert Feldt Date: 2002-01-28T18:52:35+09:00 Subject: Re: Sourcecode dump? On Mon, 28 Jan 2002, Olivier CARRERE wrote: > You're right, I've thought of this system for tuning. > The base code has to be made inside an editor (this is much more > convenient). > > I'd like to tune, for instance, for computer games, games rules and > mechanisms while running it, to instantly see what is going on. > Maybe I'd be likely to adjust the behaviour of IA objects. > > Many little adjustment which I'd like to have tracks for later use. > > And Ruby can make it (or at least a part of it!) > If someone finished Ruth it might be helpful here. I haven't touched it in 3-4 months but it should be ok to get a representation of Ruby's internal syntax tree (the ones the interpreter uses to interprete Ruby code) as Ruby objects. If you write a pretty-printer for those objects you should get Ruby code back. (Will loose comments etc and also BEGIN{} blocks but the latter can be worked-around but may not be that important) Better yet, if you write a converter to RubyAst, RubySchema, RubyTerms or whatever matju's, mine and other proposals for a way to represent the abstract syntax of Ruby is called (RAS?) you have a Ruby parser with very good compliance to matz parser (it will not be a ruby in ruby parser though!). If you write a converter back to the internal format you have a Ruby Macro system, can have zero-cost aspect-oriented programming and what have you. Not sure what matz would think though since it exposes his internal data structures. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rubyvm/src/other/ruth/ Wish I had the time... Regards, Robert Feldt