[Cython] Temps again
Stefan Behnel
stefan_ml at behnel.de
Fri Dec 5 14:10:01 CET 2008
Hi,
Dag Sverre Seljebotn wrote:
> When it comes to FlattenInListTransform, I was thinking about something
> along the lines of an "StatAsExprNode", which would be sort of the
> inverse of ExprStatNode: It would contain a block which could contain
> "ReturnFromStatAsExprNodeNode" (though a better name is needed :-))
> which would yield the value of the statement list, evaluated as an
> expression.
I thought about this, too. The main problems with TempsBlockNode are that
it a) requires the type of a temp variable before hand (which is bad for
transforms that run before type analysis), and b) is a block statement, not
an expression. Making it an ExprNode and moving the current use into a
ExprStatNode would fix that.
However, there is still a problem with things like except blocks, where
special subexpressions have a dedicated type that cannot easily be replaced
by a generic temp handling class. This currently leads to sub-optimal temps
usage e.g. for the exception value that the with-transform must catch.
Not sure if that remains a problem once we moved everything to new-style
temps. (and yes, I fear migrating NameNode, too).
Stefan
More information about the Cython-dev
mailing list