[fpc-devel] Local procedures as procedural parameter
DrDiettrich
drdiettrich at compuserve.de
Wed Mar 16 12:14:10 CET 2005
olle.r at automagika.se wrote:
>
> > Let me add some more thoughts about procedural types:
> >
> > - I like the ability to declare procedural types, the ISO convention
> > looks like one of the many incredible C hacks to me :-(
>
> But it is standard pascal. And we need to support those zillion lines of
> code out there, written in standard pascal.
Agreed, as far as I'm not pressed myself, to use constructs that I don't
like ;-)
> > - For the restricted use of local subroutines as procedural parameters I
> > could imagine a "const" prefix in the accepting procedure declaration:
> >
> > procedure my_fun(const pf: tfun);
>
> This will be unclear imo, I would prefer a directive which tells what it
> really is about.
Such an explicit directive would not be portable, unless introduced by
some accepted standard.
> > Hmm, the hidden frame parameter still will make a difference with local
> > subroutines. At least in Pascal calling convention, where the arguments
> > are popped by the called subroutine, not by the caller...
>
> The pascal calling convention is not used on most modern processors, since
> parameters instead are passed in registers.
I'd be careful with "most", the most frequently used "modern" processor
has anything but a modern architecture. But unfortunately the bundling
of bad hardware with bad software seems to be what the consumer market
appreciates :-(
DoDi
More information about the fpc-devel
mailing list