Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

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

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


bartc at freeuk

Nov 18, 2009, 3:31 AM

Post #1 of 2 (91 views)
Permalink
Re: Language mavens: Is there a programming with "if then else ENDIF"syntax?

Dotan Cohen wrote:
> 2009/11/16 Steve Ferg steve.ferg.bitbucket [at] gmail:

>> I've often thought that a language with this kind of block-free
>> syntax would be nice and intuitive:
>>
>> if <condition> then
>> do stuff
>> elif <condition> then
>> do stuff
>> else
>> do stuff
>> endif
>>
>> Note that you do not need block delimiters.

>> Does anybody know a language with this kind of syntax for
>> ifThenElseEndif?
>>
>
> PHP has exactly this:
>
> if (condition) {
> // stuff
> } elseif (otherContition) {
> // otherStuff
> } elseif (yetAnotherCondition) {
> // yetOtherStuff
> }

The OP explicitly said no block delimiters. Your example uses {..}, and
doesn't have endif.

--
Bartc

--
http://mail.python.org/mailman/listinfo/python-list


dotancohen at gmail

Nov 18, 2009, 12:20 PM

Post #2 of 2 (78 views)
Permalink
Re: Language mavens: Is there a programming with "if then else ENDIF"syntax? [In reply to]

> The OP explicitly said no block delimiters. Your example uses {..}, and
> doesn't have endif.
>

Just out of habit. I think that PHP, like C, lets you avoid the block
deliminators so long as the block all fits on one line.


--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.