[fpc-devel] Local procedures as procedural parameter
jonas at zeus.ugent.be
Mon Mar 14 11:57:40 CET 2005
On 14 mrt 2005, at 11:11, Michael Van Canneyt wrote:
> No, because normally, one never mixes 'procedure of object' with
> You program either linear, either OOP, so you either use one or the
> never both. The distinction is also very clear.
Except when programming a compiler, apparently :)
> No, because in this case, you are comparing 2 basically different
> techniques: OOP and linear; they are fundamentally different in their
> practical use.
With nested procedures, you are emulating parts of OOP using procedural
programming. They were some form of OOP avant-la-lettre.
> I don't see much code out there which mixes the two.
> (I'm talking 50-50%, not 99-1%)
They all have their own uses.
> I want to make clear that I am not against the concept "an sich".
> If the compiler was born 'out of the blue', and it supported 'iso'
> procedures from the very start, the problem would not exist. All
> (local and global) could be made 'iso-aware', and you would be able to
> both local and global functions for the same procedural parameter.
Then you'd get problems with C callbacks...
> The problem is that we are in the situation where the majority of
> existing code does not work like that, and that we have to introduce a
> 'schisma' in the compiler. I'm not particularly fond of this idea.
The "majority of existing" code depends on whose code it is. Existing
programs will not notice anything, for them declaring a procedural
variable type in a parameter list will remain impossible. It's only for
people using MacPas mode, who are used to these semantics, that things
will change (or rather remain the same compared to other compilers).
More information about the fpc-devel