hoodwink.d enhanced


to_sexp, to_c, to_ruby, too_interesting_to_pass_up #

by why in cult

Great coats. Ryan Davis thinks he’s son-shi. And I’m practically buying it, what with the cauldron’s fill of meta libs he’s brewing. And all that reading from parse tree tea leaves over on Polishing:

So… drbrain comes up to me in an IM and says flgr is saying it’d be really cool if you could ask a method for its source. I know what he is doing, baiting me like that, but I play along anyways to see what the outcome is like. drbrain and I talked about it and thought it’d be really cool if our ruby2c system added a to_c method to the Method class.

But the question came up… can we do this to display ruby code? The answer is yes, and it only took me about 30 minutes to get the proof of concept up and running.

And he’s got all the wrapper code there. All the limits of ParseTree and RubyToC apply, still my sweet tooth is literally pulsing from all the red licorice.

said on 08 Feb 2005 at 08:03

This kind of thing hurts my head. In a good way, though. Keep it up, Ryan—this is really good stuff.

said on 08 Feb 2005 at 10:08

That’s great! Now that we have this, I wonder if there’s a chance we could get “caller” and “Exception#backtrace” to return some sort of method objects instead of an array fo strings. It would be really cool to be able to better “introspect” that sort of event.

I know, there are probably all kinds of security implications from doing this wrong, but it just seems like it would be a really cool thing to have.

said on 09 Feb 2005 at 01:38

Nothing short of stunning :)

Comments are closed for this entry.