Module#include witha block

B

Bill Atkins

I'd really like to use include in block form, so I can do something like this:

def somefunc
include Wx do
f = Frame.new
t = Window.new
end
end

and the Wx:: would be implied only within the block. Any idea how I could do this?

Thanks,
Bill
 
A

Austin Ziegler

I'd really like to use include in block form, so I can do something like this:

def somefunc
include Wx do
f = Frame.new
t = Window.new
end
end

and the Wx:: would be implied only within the block. Any idea how I could do this?

The closest that I think you'll get is the "with" expression that gets
reimplemented every so often. Consider:

http://qurl.net/3e

-austin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,149
Messages
2,570,842
Members
47,388
Latest member
EarthaGilm

Latest Threads

Top