[fpc-pascal] _Release call location for unused function results

Maciej Izak hnb.code at gmail.com
Tue Jan 30 00:19:38 CET 2018


2018-01-29 23:32 GMT+01:00 Zoƫ Peterson <zoe at scootersoftware.com>:

> Is Free Pascal's behavior intentional?  Can it be changed to match Delphi?
>

the topic is well known. I have plan to add new modeswitch for that:

SCOPEDINTERFACEDESTROY

If you like you can try existing patch:

https://bugs.freepascal.org/view.php?id=30409

anyway somehow Delphi (undocumented) way seems bad. SCOPEDINTERFACEDESTROY
would be big help for legacy code ported from Delphi...

FPC has more elegant alternative way for the same thing, you can simple use
*with*:

procedure Foo;
begin
  WriteLn('Foo >');
  with Bar do
  begin
    WriteLn('Foo <');
  end;
end;

-- 
Best regards,
Maciej Izak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180130/ae7f82fd/attachment.html>


More information about the fpc-pascal mailing list