[fpc-pascal] New feature: IfThen() intrinsic

Anthony Walter sysrpl at gmail.com
Tue Feb 2 08:33:46 CET 2016


Sven,

I missed this post when you made it a two days ago. If someone hasn't
already asked, does your implementation support short circuit evaluation?

For example:

BasketCount := IfThen(ShoppingList <> nil, ShoppingList.Count, 0);

Where evaluating ShoppingList.Count will cause an exception if ShoppingList
is nil.

Also the reverse should short circuit as well:

BasketCount := IfThen(ShoppingList = nil, 0, ShoppingList.Count);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160202/12e736eb/attachment.html>


More information about the fpc-pascal mailing list