Re: [fpc-pascal] Overloading the increment operator (+=)

2011-09-12 Thread Flávio Etrusco
On Mon, Sep 12, 2011 at 2:25 AM, Jürgen Hestermann wrote: > > > Flávio Etrusco schrieb: >> >> "+=" can't be efficiently implemented with two operations (since >> concatenating the operand would be unexpected to the user...). > > Why not use "inc(x,y)"? > ___

Re: [fpc-pascal] Overloading the increment operator (+=)

2011-09-11 Thread Jürgen Hestermann
Flávio Etrusco schrieb: "+=" can't be efficiently implemented with two operations (since concatenating the operand would be unexpected to the user...). Why not use "inc(x,y)"? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lis

Re: [fpc-pascal] Overloading the increment operator (+=)

2011-09-11 Thread Flávio Etrusco
On Sun, Sep 11, 2011 at 9:22 AM, Jonas Maebe wrote: > > On 10 Sep 2011, at 22:32, Flávio Etrusco wrote: > >> Does FPC allow overloading the += operator? If not, why? > > It is translated into "x:=x+y" at the parser level, and overload resolving > happens later. So once you overload "+" (and := if

Re: [fpc-pascal] Overloading the increment operator (+=)

2011-09-11 Thread Jonas Maebe
On 10 Sep 2011, at 22:32, Flávio Etrusco wrote: > Does FPC allow overloading the += operator? If not, why? It is translated into "x:=x+y" at the parser level, and overload resolving happens later. So once you overload "+" (and := if required), "+=" should also work. Jonas __

Re: [fpc-pascal] Overloading the increment operator (+=)

2011-09-10 Thread Marcos Douglas
2011/9/10 Flávio Etrusco > > Hello, > If write a declaration without result it complains about invalid > syntax; if I add a result it says "impossible operator overload". > Does FPC allow overloading the += operator? If not, why? You do not need overload the += operator, just do it in := operator