On May 1, 9:10 am, sturlamolden <[EMAIL PROTECTED]> wrote: > I was > wondering if it is possible to emulate some of the functionality in > Python using a function decorator that evals Python code in the stack > frame of the caller. The macro would then return a Python expression > as a string. Granted, I know more Python than Lisp, so it may not work > exactly as you expect.
How about something that can't be done with a function, such as the functionality of the "with" statement that was added to python 2.5? Yes, it has to handle a suite of statements. It would be nice if it handled both the "{as target}" and no target forms. Also, it shouldn't rely on magic names - if it needs a variable for its purposes, it should guarantee that said variable and/or use can not be one that affects how the rest of the user's program behaves. There's a fair amount of relevant discussion in http://www.python.org/dev/peps/pep-0343/ . -- http://mail.python.org/mailman/listinfo/python-list