Language mavens: Is there a programming with "if then else ENDIF" syntax?

Robin Becker robin at reportlab.com
Mon Nov 16 12:03:20 EST 2009


Steve Ferg wrote:
.........
> 
>     if <condition> then
>         do stuff
>     elif <condition> then
>         do stuff
>     else
>         do stuff
>     endif
> 
> Note that you do not need block delimiters.
> 
> Obviously, you could make a more Pythonesque syntax by using a colon
> rather then "then" for the condition terminator.  You could make it
> more PL/I-like by using "do", etc.
> 
> You can write shell scripts using if ... fi, but other than that I
> don't recall a language with this kind of syntax.
> 
> Does anybody know a language with this kind of syntax for
> ifThenElseEndif?
.......

modern sh seems to use this with "fi" as endif eg

~:
$ if true; then
 > echo true
 > elif false; then
 > echo false
 > else
 > echo hostile logic
 > fi
true
~:
$

-- 
Robin Becker




More information about the Python-list mailing list