[m-users.] Idiomatic Mercury - if-then-else or (C->I;E)

Mark Brown mark at mercurylang.org
Mon Nov 23 20:15:40 AEDT 2015


On Mon, Nov 23, 2015 at 5:06 PM, Richard A. O'Keefe <ok at cs.otago.ac.nz> wrote:
>
> On 23/11/2015, at 5:08 pm, Mark Brown <mark at mercurylang.org> wrote:
>> So I'd like to add another reason for using if-then-else, which is
>> that across programming languages it is used much more consistently
>> than any kind of arrow.
>
> Consistency?  You *really* believe that there is
> any great consistency across programming languages?

Yes, but I don't mean to claim that semantic constructs have any
consistent representation in syntax, only that some pieces of syntax
have consistent semantics across languages. If the syntax is `if ...'
then `...' is virtually always the condition. Likewise `then' is
followed by the affirmative code and `else' by the negative code.

> Do NOT mistake the quirks of C syntax
> (or even of Ada or Fortran syntax) for programming
> language universals.  Not even 'function call' syntax
> is universal.  For that matter, neither are integers.

Your point is well heeded.

Mark



More information about the users mailing list