matt neuburg wrote:

> Some languages have a "with" construction, where undefined methods are
> routed to a designated object. Here's an example from UserTalk:
> 
> with system.startup {
>    string(license)
> }
> 
> UserTalk knows what "string" is, but when it can't find "license" it
> reinterprets it as system.startup.license, which works. In UserTalk, you
> can even chain these tests:
> 
> with system.temp, system.startup {
>    string(license)
> }
> 
> That means we try system.temp.license and if that doesn't exist we
> proceed to system.startup.license.
> 
> So my question is: is Ruby amenable to this kind of construction? Is
> there a way to bend the language to that it acts like this? Thx - m.

Not AFAIK. IMHO the ultimate "with" construction is to create a class or
module that includes all the required named methods and then operate inside
the class. This gives you the same shorthand syntax and seems to me to be
more attuned to OO principles.

-- 
Paul Lutus
http://www.arachnoid.com