Frank Heckenbach wrote:
Waldek Hebisch wrote:
I personaly think that procedure variables are more elegant than procedure pointers, but IMHO without a 100% reliable way to prevent call procedure variables just are broken.
My be difficult. If foo is a procedural (or functional) variable, then
bar := foo;
can be a call if bar is of the result type. Of course, you can always do `@foo' (according to BP, this does not give the address of the variable, but casts it to a pointer type). This should always prevent a call AFAICS.
But `@foo' is a pointer! So we have a way to prevent call using pointers. But logically, to assign to a procedure variable we need a cast, and the problems cames back -- note that the problem not only involves procedures, but _all_ procedure valued expressions (including casts). That is why I think that procedure pointers are better -- they work always with uniform syntax.