Greg Ewing, 17.07.2010 03:09:
> Stefan Behnel wrote:
>> No, I think the only way to deal with this early enough is to introduce a
>> ReusedExpression node, and to handle that basically everywhere
>
> There was discussion a while back about some kind of
> LetNode -- did you implement that? Wouldn't it give you
> what you need here?

Yes, we have that, although the corresponding node here is the LetRefNode 
that holds the result itself.

When I initially wrote the above, I was looking into issues related to the 
ref-counting done by the LetRefNode. We currently use it for a couple of 
different use patterns, and some of them don't work correctly. For example, 
it's a difference if you just use it to reference a value that it owns, or 
if you keep reassigning other values to its temp variable. The latter 
doesn't currently work. It may be possible to make it work locally within 
the current nodes, but I'm not sure it is. Reassigning to temp variables 
isn't really something that is supported by the current infrastructure. 
That's the main issue here. There is currently no way to say that a temp 
variable already holds an owned reference that needs decref-ing.

Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to