[fpc-devel] Re: [fpc-l] type discussion

Marco van de Voort marcov at stack.nl
Thu Jun 2 17:57:43 CEST 2005

> >> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> >> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> >>
> > MyObject.Create is impossible with classes on the heap. You need to 
> > assign MyObject a pointer but you can't do that from within create.
> sorry myobject is the pointer so a better example would be :
> var strlist : Tstringlist;
> strlist.create;
> This should be easy as you know the pointer type.

Syntactic sugar. Read the faq ;)
> > 
> > Forward declarations are IMHO required because otherwise the compiler 
> > would have to make additional passes(it does 3 AFAIK).
> They are not required in a multipass compiler. 

They can be. A multipass compiler doesn't necessarily spend multiple passes
in the parser.

> If you cant resolve a 
> symbol on a single pass you can do so on a subsequent one.

This limits the amount of stuff you can do in the subsequent pass, since
nothing is required to be resolved yet. And passes are expensive,
compiletime wise.

Also, I simply don't see the use of it. Borland Pascal's have the forward
directive for those really few cases where it is annoying.

> > Besides, they are seldom enough to be a problem.
> Pain in the arse they are. Its annoying and makes use of the code 
> explorer a neccsity when dealing with large classes. Its a total waste 
> of my time.

Then improve the code explorer.

More information about the fpc-devel mailing list