Dag Sverre Seljebotn wrote:
> A way to get around this would be to split generate_result_code. So 
> mainly my proposal, but with this modification:
> 
> self.subexpr.preparation_code(code)
> tmp = code.funcstate.allocate_temp(...)
> self.subexpr.store_result_code(tmp, code)

That's something I thought about, too. Most of the time, within an
expression, all you really want is to say "do whatever it takes to
calculate the result, and then put it *here*", where 'here' may be a temp
or a name.

How would the DECREF handling work for the target in that case? If it's a
temp, I'd expect it to be empty in any case, but if it's a variable name,
it needs a DECREF-after-INCREF. Or would the parent always hand in a temp
and always handle variables itself?

If we call this directly, we could also pass keyword arguments like
"target_needs_decref" and "make_owned_reference".

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

Reply via email to