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

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Tue Feb 2 09:07:48 CET 2016


LacaK wrote:
>> Switch, Select, Which
>> are all good except that they are very common English words. They 
>> might already be used by users in existing function names in their code.
>>
>> I prefer
>>
>> V := If Condition then ThenExpr else ElseExpr;
> +1
> (for me is "if ... then ... else" also good understandable and looks nice;
>  plus if it has precendence in other language (Oxygene) it is advantage 
> also)

Plus it has precedenence in at least some ALGOL implementations (a quick 
read of my fading manual doesn't show whether it was still in ALGOL W). 
I've never understood why it was omitted from Pascal, although 
somebody's comment about operator priority and the heavy going that some 
texts make of describing nesting suggest that there are hazards, at 
least for people who aren't already familiar with the language.

-- 
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-pascal mailing list