A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-February/152086.html below:

[Python-Dev] A minimal Python interpreter written in Python for experimenting with language changes

[Python-Dev] A minimal Python interpreter written in Python for experimenting with language changes [Python-Dev] A minimal Python interpreter written in Python for experimenting with language changesSteven D'Aprano steve at pearwood.info
Sat Feb 3 02:27:46 EST 2018
On Sat, Feb 03, 2018 at 01:01:30AM +0100, asrp asrp wrote:

> I've made a small Python interpreter in Python with runtime AST node 
> semantics and edit-and-continue. I thought it could make prototyping 
> language changes more easily and visualize usage before writing them 
> in C.

That sounds interesting.


> Its here: https://github.com/asrp/python_terp
> 
> So, for example, redefining the for_stmt function in the right scope 
> changes the behaviour of future for loops at runtime.

Can you give an example of how you would do that? I don't mean the 
mechanism used, I mean how would a developer implement a new syntactic 
feature. Suppose I wanted to add a new clause to for...else, let's say:

    for ... :
       block
    otherwise:
       # runs only if the for-loop was empty

How would do I do that?

(I've read the example on your github page, and it doesn't have much 
detail.)



-- 
Steve
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4