I just noticed I sent this to the wrong person and the list never saw it so I’m 
sending it again. I feel like I should try to fix it while I’ve got my eyes on 
the generics code before I forget. 

Is there a reason it’s not implemented yet? In theory you should be able to 
specialize a function as a type and use the type name as the function name. 
This is basically the same syntax for class construction but without the 
.create.

====================

As a side node I haven’t been willing to use generic functions yet because the 
syntax is so verbose it kind of defeats the purpose.

Why can’t we specialize functions as a type? Maybe that’s on the todo list also?

generic procedure DoThis<T>(msg:string);
begin
        writeln(msg, ' ',sizeof(T));
end;

type
        DoInt = specialize DoThis<integer>;

begin
        DoInt(‘hello');

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to