Re: [Cython] Out of order side effects of argument evaluation in function calls (ticket #654)

2011-03-17 Thread Jason Grout
On 3/16/11 11:05 PM, Robert Bradshaw wrote: On Wed, Mar 16, 2011 at 7:53 AM, Stefan Behnelstefan...@behnel.de wrote: I'm actually leaning towards not guaranteeing the order of execution if C doesn't do it either. If this is really required, it's easy to work around for users, but it's severely

Re: [Cython] Out of order side effects of argument evaluation in function calls (ticket #654)

2011-03-17 Thread Robert Bradshaw
On Thu, Mar 17, 2011 at 6:15 AM, Jason Grout jason-s...@creativetrax.com wrote: On 3/16/11 11:05 PM, Robert Bradshaw wrote: On Wed, Mar 16, 2011 at 7:53 AM, Stefan Behnelstefan...@behnel.de  wrote: I'm actually leaning towards not guaranteeing the order of execution if C doesn't do it

Re: [Cython] Out of order side effects of argument evaluation in function calls (ticket #654)

2011-03-17 Thread Vitja Makarov
2011/3/17 Robert Bradshaw rober...@math.washington.edu: On Thu, Mar 17, 2011 at 6:15 AM, Jason Grout jason-s...@creativetrax.com wrote: On 3/16/11 11:05 PM, Robert Bradshaw wrote: On Wed, Mar 16, 2011 at 7:53 AM, Stefan Behnelstefan...@behnel.de  wrote: I'm actually leaning towards not

Re: [Cython] Out of order side effects of argument evaluation in function calls (ticket #654)

2011-03-16 Thread Stefan Behnel
Robert Bradshaw, 11.03.2011 19:33: On Fri, Mar 11, 2011 at 9:36 AM, Stefan Behnelstefan...@behnel.de wrote: Stefan Behnel, 11.03.2011 15:08: Vitja Makarov, 11.03.2011 15:04: 2011/3/11 Stefan Behnel: Personally, I think it would be nice to keep up Python's semantics, but when I

Re: [Cython] Out of order side effects of argument evaluation in function calls (ticket #654)

2011-03-16 Thread Robert Bradshaw
On Wed, Mar 16, 2011 at 7:53 AM, Stefan Behnel stefan...@behnel.de wrote: Robert Bradshaw, 11.03.2011 19:33: On Fri, Mar 11, 2011 at 9:36 AM, Stefan Behnelstefan...@behnel.de  wrote: Stefan Behnel, 11.03.2011 15:08: Vitja Makarov, 11.03.2011 15:04: 2011/3/11 Stefan Behnel: Personally,

Re: [Cython] Out of order side effects of argument evaluation in function calls (ticket #654)

2011-03-11 Thread Greg Ewing
Stefan Behnel wrote: This introduces problems when the arguments have side effects or are not simple, e.g. f(g(a), a.x, h(a)) What do you think about this? I think it's a bad idea to write code that relies on the order of evaluation like this. If the order matters, it's better to be

Re: [Cython] Out of order side effects of argument evaluation in function calls (ticket #654)

2011-03-11 Thread Greg Ewing
Stefan Behnel wrote: To be a little clearer here, it's a problem in C for example with struct values. Copying them by value into a temp variable can be expensive, potentially twice as expensive as simply passing them into the function normally. What are you actually proposing to do here?