Returning a value from exec or a better solution

Jack Trades jacktradespublic at gmail.com
Tue Aug 30 18:45:58 EDT 2011


On Tue, Aug 30, 2011 at 1:19 PM, Ethan Furman <ethan at stoneleaf.us> 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<http://nickzarr.com/blog4/series/scheme-in-python/>and the github
is
here <https://github.com/jacktrades/Scheme-in-Python>.  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 <http://pointlessprogramming.wordpress.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110830/8e42a2af/attachment-0001.html>


More information about the Python-list mailing list