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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to