Re: [fpc-pascal] generics question

2011-05-14 Thread Sven Barth
I have not yet looked at the parsing of methods of generic classes during my work on the generics, but when I'll implement generic methods I'll try to take a look at your problem. Regards, Sven On 12.05.2011 12:37, Adrian Veith wrote: Hi, I try this: type TTestGen = class construc

Re: [fpc-pascal] Re: generics question

2011-05-14 Thread Adrian Veith
But is very strange, that this works: type TTestGen = class constructor Create(); class function Test(val: T): string; inline; end; function Blah(const val: Integer): string; inline; //overload; begin Result:= IntToStr(val + 1); end; {function Blah(const val: string): string; inli

[fpc-pascal] Re: Macro Processing

2011-05-14 Thread leledumbo
No for me, FPC has everything a macro could do (in a safer manner sometimes). The current macro implementation is enough for me (I just use it to save some typing when writing bindings with incompatible calling convention between platforms). -- View this message in context: http://free-pascal-gen

[fpc-pascal] Re: generics question

2011-05-14 Thread leledumbo
Err... because at the time, T is not yet known. It would still fail to compile even if you don't do any specialization. I guess the compiler does type checking while parsing the generic class (and its methods) declaration, not while specializing (well... it would still do type checking when special

Re: [fpc-pascal] Oberon Day 2011, N. Wirt speaking!

2011-05-14 Thread greim
Jeppe, Do you know if the talks there will be recorded? Could be nice :) i don't know, i am not part of the organizing committee, but i will post any link here. Markus ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freep

[fpc-pascal] Re: Register variables slowing down floating point operations

2011-05-14 Thread andrew.bennett
On Thu, 12 May 2011 20:54:16 +0200 cobines wrote > I have written the following program: > ... > max := 1; > for i := 0 to max do > vd := i / max; A really smart compiler would notice that this in this loop the value of vd is never examined, the loop being equivalent to