[fpc-devel] Optimizing unused return values of inline functions

Michael Van Canneyt michael at freepascal.org
Tue Aug 22 14:47:48 CEST 2017



On Tue, 22 Aug 2017, Sven Barth via fpc-devel wrote:

>>
>>
>> Call me old-fashioned, but I much prefer
>>
>>   With StdIO::stdOutPrinter() do
>>     begin
>>     out("Helllo World ");
>>     out(42);
>>     out("");
>>     hex();
>>     out(42);
>>     line();
>>     end;
>>
>> I see no point or gain in the "fluent" code.
>
> First C++ has no with-statement and second I definitely prefer my output to
> be on one line. :)

    With StdIO::stdOutPrinter() do begin out("Helllo World ");out(42);out("");hex();out(42);line(); end;

;)

> Also in other cases fluent interfaces are rather nice to have.
> Though they also don't force you to be used in that way :) (at least if
> they really only return Self/This).

I guess it is a matter of style.

Michael.



More information about the fpc-devel mailing list