code is data

Kay Schluehr kay.schluehr at gmx.net
Tue Jun 20 05:03:31 EDT 2006


Fredrik Lundh wrote:
> Kay Schluehr wrote:
>
> > If it is just a different kind of representation of common data
> > structures
>
> but how do you know ?
>
> </F>

The semantics is specified by the syntax transformer so it is actually
compile-time semantics relative to the base language Python . For any
custom statement/expression ( expressed by a production rule / node in
the parse-tree ) one or more target statements/expressions in standard
Python are created. The specification of the with-statement in PEP 343
can be regarded as a good example of this definition practice. The
with-statement is expanded to a "protocol" that can be expressed in
Python 2.4. In a more general case this expansion might involve
additional libraries e.g. ctypes or elementree.




More information about the Python-list mailing list