From: Its Me Date: 2004-04-08T05:14:18+09:00 Subject: Re: Idea: Simplified GTK "Hal Fulton" wrote in message news:407444BD.1090604@hypermetrics.com... > You coded the same thing I did in half the time, and it's prettier. I > find that disgusting. ;) > > I was using an explicit stack in a class variable for the containers. > This is much nicer, and I need to eyeball it and make sure I get it. Dynamically scoped variables do precisely what your "explicit stack" was doing: http://pragprog.com/pragdave/Tech/Random/StackContext.rdoc The code I posted elsewhere on this thread uses Avi Bryant's implementation. It let's us set up defaults with systematic overriding, including default blocks: class A @@defaults = {:HBox => {:fill => ....} } end def foo with_context (:A.defaults) { bar } end def bar with_context ( {:other => "stuff"} ) { baz } end def baz ...find_in_context (:other) ...find_in_context (:HBox) ...find_in_context [:HBox, :fill] end (Avi Bryan't startlingly concise implementation uses continuations. Continuations make my head hurt but they sure seem to be powerful things).