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

Jamie McCracken jamie-junk at blueyonder.co.uk
Thu Jun 2 17:37:30 CEST 2005

Michael Van Canneyt wrote:

> But the compiler needs to check many things:
> 1. Initialize the S with Nil.
> 2. Check that S is assigned only once during the lifetime of the
>    procedure.
>    This is actually a bigger restriction than you might think,
>    unless you want to introduce reference counting.
> 3. Put a try/finally block and generate a call to S.Destroy at the end.
>    It must also catch any errors that may occur when s.destroy is
>    called. For classes, this danger is very real; For ansistrings it is
>    not (well, very small)
> 4. It cannot assign S to anything, since that could mean that the
>    lifetime of S could be prolonged. The alternative is again again ref. 
> counting.
> This is not so easy, and reference counting is always a mess...

Well you already have the code for ref counting for com objects so its 
not like its a ton of work and therefore we dont need to worry about 
your four points. Adding C++ style exception handling should make it 
fast enough too (ok that is some work).


> Michael.
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel

More information about the fpc-devel mailing list