Re: [fpc-pascal] how to convert this to mode objfpc

2015-05-11 Thread misu kun
thanks so much Sven , ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] how to convert this to mode objfpc

2015-05-11 Thread Sven Barth
Am 11.05.2015 17:23 schrieb "Sven Barth" : > > Am 11.05.2015 16:49 schrieb "misu kun" : > > > > thanks > > in objfpc mode i can imagine this ,but it didn't work unless i specialize (obj) > > > > > > type > > generic obj = object > > x : T; > > end; > > operator + (arg1 ,ar

Re: [fpc-pascal] how to convert this to mode objfpc

2015-05-11 Thread Sven Barth
Am 11.05.2015 16:49 schrieb "misu kun" : > > thanks > in objfpc mode i can imagine this ,but it didn't work unless i specialize (obj) > > > type > generic obj = object > x : T; > end; > operator + (arg1 ,arg2 : obj):obj; // error : here (obj) needs specialization > begin >

Re: [fpc-pascal] how to convert this to mode objfpc

2015-05-11 Thread misu kun
thanks in objfpc mode i can imagine this ,but it didn't work unless i specialize (obj) type generic obj = object x : T; end; operator + (arg1 ,arg2 : obj):obj; // error : here (obj) needs specialization begin result.x := arg1.x + arg2.x; end; _

Re: [fpc-pascal] how to convert this to mode objfpc

2015-05-11 Thread Graeme Geldenhuys
On 2015-05-11 14:10, misu kun wrote: > Hi > what is the equivalence of this code using mode objfpc ? > btw , it compile fine with {$mode delphi} See: http://wiki.freepascal.org/Generics Also look at the FPC Language Reference documentation for Generics. The syntax is slightly different to Delph

[fpc-pascal] how to convert this to mode objfpc

2015-05-11 Thread misu kun
Hi what is the equivalence of this code using mode objfpc ? btw , it compile fine with {$mode delphi} type obj = object x : T; class operator add (arg1 ,arg2 : obj):obj; inline; end; class operator obj.add (arg1 ,arg2 : obj):obj; begin