[fpc-devel] new features and facilities
Mark Morgan Lloyd
markMLl.fpc-devel at telemetry.co.uk
Thu Oct 8 20:10:46 CEST 2015
Ralf Quint wrote:
> On 10/8/2015 9:54 AM, Sven Barth wrote:
>>
>> I had the idea to implement inline-if as well. I think the syntax I
>> selected is derived from Oxygene, but it looks very Pascal and
>> shouldn't break anything:
>>
>> left := if expr1 then expr2 else expr3;
>>
>> Thereby expr1 returns Boolean and expr2 determines the type of the
>> whole inline-if, thus expr3 needs to be compatible to expr2.
>>
>>
> Sorry, but that doesn't "look Pascal" at all, and is anything but easily
> understandable, specially given the possible complexity of expr[1,2,3]...
But at least in this instance there's /always/ an ELSE, so there's no
risk of apparent ambiguity due to "dangling else": a closing END or FI
isn't needed.
It's more difficult to argue for inline CASE, particularly since that
one might have optional ELSE or OTHERWISE.
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
More information about the fpc-devel
mailing list