Returning a value from exec or a better solution

Jack Trades jacktradespublic at
Wed Aug 31 00:45:58 CEST 2011

On Tue, Aug 30, 2011 at 1:19 PM, Ethan Furman <ethan at> wrote:

> I spoke a bit too soon with the "works flawlessly" post.  In addition to
>> your issue, there is also the problem that supplying an empty environment
>> does not allow the user to call necessary functions (like scheme_eval).
> So, just like an implementation, add the functions to the CapturingDict
> before the exec.
I will probably do that a bit down the road, that also allows exporting only
the things that are absolutely necessary, which is a huge plus.  Right now
I'm trying to keep the code as simple as possible as this Scheme interpreter
is being written as a tutorial in a similar fashion to "An Incremental
Approach to Compiler Construction".  I'll add a note about this method of
implementation and link to this discussion.

In the off chance anyone is interested, the series is
here<>and the github
here <>.  It's still very much
in draft form and will probably undergo a number of rewrites, but criticism
is always welcome.

Nick Zarczynski
Pointless Programming Blog <>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list