From: Patrik Sundberg Date: 2009-11-13T04:38:08+09:00 Subject: Re: Separate code space/sandbox? Caleb Clausen wrote: > Commentary: > 1) This is considerably more complicated (=uglier) than Bill's > attempt. There's even an eval lurking in there, which oughtn't be > necessary when using macros. However, it does seem to fulfill all your > requirements. > > 2) A more sophisticated variable renaming scheme may be required if > you want your program to have variables which end with an underscore. > > 3) Use of eval inside a separated_scope will confuse things. Variables > used in the eval arg will refer to the outer scope, not the separated > scope. > > 4) Macros are not a standard part of ruby syntax; they require my > macro preprocessor, rubymacros. do a 'gem install rubymacros' to get > it. > Also see http://github.com/coatl/rubymacros > > 5) Code that defines or uses macros must be pulled into the > interpreter using a special version of require: Macro.require. That's > why there's a separate file which requires 'macro', then calls > Macro.require. Awesome! I had not seen rubymacros before. I'll dig into this and try to understand it in more detail. Thank you very much for the help. -- Posted via http://www.ruby-forum.com/.