Good day!

There is

type TFunc=function (n:byte; i:longint):byte; function a1(n:byte; i:longint):byte; begin end; 

Further, +100500 functions with the same record were announced ... I would like to make one “template” and not rewrite the same prototype for each function. Is it possible? Or maybe you can somehow remove the repeated line in another way?

  • uh ... and you also want to remove the implementation of the functions in the template? - VladD
  • one
    over9000 implementations? It smacks of manual creation of arrays with the establishment of variables a1, a2, a3 .. an instead of an array. - KoVadim
  • Well, he wants to. Only here the language for such exercises to put it mildly inappropriate. Such crap - either for languages ​​with functional means, or evidence of a phase shift. - alexlz
  • Maybe a person does what, in fact, a code generator should do. - KoVadim
  • @alexlz: ... or manually write the source code generator :) on the same Delphi. - VladD

1 answer 1

I figured out how to do something like that =)

 {$MACRO ON} {$DEFINE __func:=(x:extended):extended} function f __func; begin end;