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

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Nov 23 17:26:45 AEDT 2015



On Mon, 23 Nov 2015 19:06:36 +1300, "Richard A. O'Keefe" <ok at cs.otago.ac.nz> wrote:

Nice to hear from you again, Richard. How is life treating you?

> On 23/11/2015, at 5:08 pm, Mark Brown <mark at mercurylang.org> wrote:
> > I must confess that, as a newbie Prolog programmer, this was not my
> > first hypothesis. :-(
> 
> You must remember that all the original Prolog
> developers knew Lisp quite well, including familiarity
> with the Lisp 1.5 manual.

I do know that. However, knowledge of the List 1.5 manual
is scarce among even declarative language programmers today,
and for this discussion, that is a more relevant audience.

> > 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?

You are right; there are lots of languages that wildly dissimilar
syntaxes for conditionals. (And you didn't even show Lisp's
syntax ...)

However, if you weigh languages by popularity, either in
the general population of programmers or more personally
in the population of the people working on the Mercury project,
there *is* a sort-of dominant syntax family  for if-then-elses,
which is the syntax used in the Algol/Pascal/C/Java family.
I am pretty sure this is what Mark was referring to.

Zoltan.





More information about the users mailing list