12.01.2011 13:28, kingbiz...@gmail.com wrote:
The problem: we have to do *one function for every type*, on the C and
PHP method is is *globally*
If we want one for Integer we must declare one for it, if we want one
for X we need to declare it...

I want to know from you, what you would think about it on FPC? I don't
belive that it is a hard feature to implement and is helpfull. I'll be
waiting for your response!

Similar to delphi generic method:
 function IIf<T>(Condition: Boolean; IfTrue, IfFalse: T): T;
 begin
   if Condition then
     Result := IfTrue
   else
     Result := IfFalse;
 end;

I'm working on this functionality for classes, objects and record methods.

But even delphi does not have it for regular procedures/functions. I suppose because regular procedures/functions does not support overloading.

Best regards,
Paul Ishenin

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to