[fpc-devel] Parameters must match exactly?

"Vinzent Höfler" JeLlyFish.software at gmx.net
Tue May 18 07:40:45 CEST 2010

Florian Klaempfl <florian at freepascal.org>:

> Vinzent Höfler schrieb:
> > Florian Klaempfl <florian at freepascal.org>:
> > 
> >> Graeme Geldenhuys schrieb:
> >>
> >>> This compiler change will play havoc on the Simple Factory Method
> design
> >>> pattern as well - a base class is used as the parameter type, but
> >>> descendants are created and passed back. This is a very common case
> and
> >>> used a lot.
> >> ... and one uses normally a function and not a var/out parameter.
> > 
> > And return the error code in an out parameter instead? Great idea. So
> readable. So much in the spirit of Pascal.
> Doing/allowing unsafe implicit type casts is neither in the spirit of
> pascal.

You wouldn't *need* typecasts. It's a pointer and the instance it is pointing to will be initialized by the subroutine you're calling. And that one *knows* the size of the class it created. So there's typecast involved at all, if used correctly.

And stop calling me clueless, please. Just because you do not understand what I write, doesn't exactly mean, I am the one who has no clue.


GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

More information about the fpc-devel mailing list