<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 21 May 2015 at 17:12, Ethan Furman <span dir="ltr"><<a href="mailto:ethan@stoneleaf.us" target="_blank" class="cremed">ethan@stoneleaf.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 05/21/2015 04:33 PM, Greg Ewing wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Steve Dower wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
It's only a macro system when you generate code in unexpected/unobvious places with it. This is more like inspect.getsource(), but going straight to the AST.<br>
</blockquote>
<br>
Is it really that much different? The end result is<br>
the same -- the user writes something that looks like<br>
a Python expression, but it gets evaluated using some<br>
other set of semantics that can be arbitrarily different<br>
from Python's.<br>
</blockquote>
<br></span>
I think the key difference is that the AST is not going to be converted to run different Python code under Python, but under some other language -- presumably to implement the semantics of the Python snippet.<br></blockquote><div><br></div><div>As a simple example, a "macro" with access to the AST could decide to not evaluate something, whereas normal Python rules would be to evaluate (similar to wrapping with LISP QUOTE or LAMBDA). This would make PEP484 simpler (e.g., no need for special handling of "forward" references to types).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
--<br>
~Ethan~<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank" class="cremed">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank" class="cremed">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/pludemann%40google.com" target="_blank" class="cremed">https://mail.python.org/mailman/options/python-dev/pludemann%40google.com</a><br>
</div></div></blockquote></div><br></div></div>