hoodwink.d enhanced


Painting The MetaTown Red #

by why in cult

You can’t go anywhere without reading about metaprogramming in Ruby. I tried passing through a turnstyle on my way out of the arcade tonight and—boof—a whole blog on meta stuff was jammed right there!!

Oliver Steele, creator of Lazlo, just got done talking all admirably about Ruby’s meta. I agree. The ability to add to Class and use those methods like a definition—that’s the stuff railsers lick straight from the raw honeycomb. He compares some Ruby and Lazlo snips, which rules if you want a taste of Lazlo.

Okay, so, ready for some real metaprogramming code?? Aslak Hellesoy has offered a simple bit o’ annotations for attaching arbitrary metadata to a class. Perfect. Thank Curt Hibbs on your way out, he’s the one who floated this on to Ruby-Talk.

said on 10 Mar 2005 at 03:06

Hmm this annotation thing is really cool. There is something similar (and quite more advanced, for example supports inheritance) in Og and Nitro, but i kinda like how this version reuses the attr_accessor instead of defining a new ‘macro’. Btw what about attr_writer ?

Comments are closed for this entry.