Re: [fpc-pascal] Re: Feature proposal: function-based assignment operators

2013-04-02 Thread Marc Weustink
On 28-3-2013 17:52, Jonas Maebe wrote: += does *not* prevent re-evaluating the left side. It is internally translated to x:=x+y and then evaluated like normal. So if x contains a function call with side effects, these side effects are still triggered twice. Is evaluated as x := x + y or as x

Re: [fpc-pascal] Re: Feature proposal: function-based assignment operators

2013-04-02 Thread Jonas Maebe
On 02 Apr 2013, at 11:11, Marc Weustink wrote: On 28-3-2013 17:52, Jonas Maebe wrote: += does *not* prevent re-evaluating the left side. It is internally translated to x:=x+y and then evaluated like normal. So if x contains a function call with side effects, these side effects are still

[fpc-pascal] Re: Feature proposal: function-based assignment operators

2013-03-28 Thread leledumbo
Hmm... Haskell? Or Nimrod? Or something else? What's the benefit? How will it affect existing code? Last but not least, will you implement it? -- View this message in context:

Re: [fpc-pascal] Re: Feature proposal: function-based assignment operators

2013-03-28 Thread Benito van der Zander
What's the benefit? Same benefit as += to := ... + You do not need to rewrite/compute the left side How will it affect existing code? Not at all, since old code using this, would not compile Last but not least, will you implement it? I can try On 03/28/2013 04:20 PM, leledumbo wrote:

Re: [fpc-pascal] Re: Feature proposal: function-based assignment operators

2013-03-28 Thread Jonas Maebe
On 28 Mar 2013, at 17:50, Benito van der Zander wrote: What's the benefit? Same benefit as += to := ... + You do not need to rewrite/compute the left side += does *not* prevent re-evaluating the left side. It is internally translated to x:=x+y and then evaluated like normal. So if x

[fpc-pascal] Re: Feature proposal: function-based assignment operators

2013-03-28 Thread leledumbo
Same benefit as += to := ... + You do not need to rewrite/compute the left side Save typing only then, the same mistake the C style operator support have done. -- View this message in context:

[fpc-pascal] Re: Feature proposal: function-based assignment operators

2013-03-28 Thread leledumbo
As to the C-style += operator, I have one question, will it makes code slightly faster? because if you use Inc() or Dec() there will be a function call? or, the compiler will always try to inline Inc or Dec? No, as been explained, it's internally translated to the equivalent non-C style by the