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

2009-12-03 Thread Michael Torrie
Steven D'Aprano wrote: But you're right, the convention of using verbs for functions isn't as strong as the convention of using nouns for classes and types. The idea that functions should be verbs is plain wrong, coming from the traditional world of functional programming. Since functions

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

2009-12-03 Thread Michael Torrie
Steve Ferg wrote: Is there any particular reason why this might be a *bad* language- design idea? Syntactically, using braces, begin/end blocks, python white space, and your if/elif/then/endif structures, amounts to the same thing; they are all equivalent. Thus from a language pov, there's no

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

2009-12-03 Thread Robert Kern
On 2009-12-03 14:56 PM, Michael Torrie wrote: I'm not sure, but Python's grammar is LL(1) I think, and probably darn close to context-free. It is LL(1) after some non-formal postprocessing of the tokens to properly handle the indentation. -- Robert Kern I have come to believe that the

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

2009-12-03 Thread James Harris
On 3 Dec, 20:56, Michael Torrie torr...@gmail.com wrote: Steve Ferg wrote: Is there any particular reason why this might be a *bad* language- design idea? Syntactically, using braces, begin/end blocks, python white space, and your if/elif/then/endif structures, amounts to the same thing;

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

2009-11-20 Thread Aahz
In article ff92db5b-9cb0-4a72-b339-2c5ac02fb...@p36g2000vbn.googlegroups.com, Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: Does anybody know a language with this kind of syntax for ifThenElseEndif? Several templating systems, including Cheetah. -- Aahz (a...@pythoncraft.com) *

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

2009-11-18 Thread Steve Howell
On the topic of switch statements and even-more-concise-then-we-have- already if/elif/else/end constructs, I have to say that Python does occasionally force you to write code like the code below. Maybe force is too strong a word, but Python lends itself to if/elif blocks like below, which get the

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

2009-11-18 Thread Chris Rebert
On Wed, Nov 18, 2009 at 1:15 AM, Steve Howell showel...@yahoo.com wrote: On the topic of switch statements and even-more-concise-then-we-have- already if/elif/else/end constructs, I have to say that Python does occasionally force you to write code like the code below.  Maybe force is too

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

2009-11-18 Thread Steve Howell
On Nov 18, 1:32 am, Chris Rebert c...@rebertia.com wrote: On Wed, Nov 18, 2009 at 1:15 AM, Steve Howell showel...@yahoo.com wrote: On the topic of switch statements and even-more-concise-then-we-have- already if/elif/else/end constructs, I have to say that Python does occasionally force you

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

2009-11-18 Thread Steve Howell
On Nov 18, 1:32 am, Chris Rebert c...@rebertia.com wrote: On Wed, Nov 18, 2009 at 1:15 AM, Steve Howell showel...@yahoo.com wrote: On the topic of switch statements and even-more-concise-then-we-have- already if/elif/else/end constructs, I have to say that Python does occasionally force you

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

2009-11-18 Thread Simon Brunning
2009/11/17 sjm sjms...@gmail.com: On Nov 16, 12:54 pm, Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: snip Does anybody know a language with this kind of syntax for ifThenElseEndif? Modern-day COBOL: IF      some-condition        do-something ELSE        do-something-else END-IF.

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

2009-11-18 Thread Simon Forman
On Wed, Nov 18, 2009 at 4:15 AM, Steve Howell showel...@yahoo.com wrote: On the topic of switch statements and even-more-concise-then-we-have- already if/elif/else/end constructs, I have to say that Python does occasionally force you to write code like the code below.  Maybe force is too

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

2009-11-18 Thread Steven D'Aprano
On Wed, 18 Nov 2009 09:33:38 +0200, Dotan Cohen wrote: Is there any particular reason why this might be a *bad* language- design idea? It is about as far from OO as one could get. Whether or not that is bad depends on the use case. That's crazy talk. IF...ENDIF is *syntax*, not a

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

2009-11-18 Thread Steven D'Aprano
On Wed, 18 Nov 2009 01:53:50 -0800, Steve Howell wrote: On Nov 18, 1:32 am, Chris Rebert c...@rebertia.com wrote: On Wed, Nov 18, 2009 at 1:15 AM, Steve Howell showel...@yahoo.com wrote: On the topic of switch statements and even-more-concise-then-we-have- already if/elif/else/end

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

2009-11-18 Thread Steve Howell
On Nov 18, 2:22 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Wed, 18 Nov 2009 02:06:49 -0800, Steve Howell wrote: P.S. The underscores before the method names might look a little funny for inner methods, but it's the nature of the code..._dict and _list would lead to

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

2009-11-18 Thread Steve Howell
On Nov 18, 3:02 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: That depends on the code. In particular, it depends on how coupled the code is. Ideally, you should have loosely coupled code, not highly coupled. If the code is loosely coupled, then there's no problem with

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

2009-11-18 Thread Steven D'Aprano
On Wed, 18 Nov 2009 15:58:24 -0800, Steve Howell wrote: On Nov 18, 2:22 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Wed, 18 Nov 2009 02:06:49 -0800, Steve Howell wrote: P.S. The underscores before the method names might look a little funny for inner methods, but

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

2009-11-18 Thread Steve Howell
On Nov 18, 3:02 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: Lexical duplication is one of the weakest code smells around, because it is so prone to false negatives. You often can't avoid referring to the same lexical element multiple times: def sinc(x):     if x != 0:  

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

2009-11-18 Thread Steve Howell
On Nov 18, 5:13 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Wed, 18 Nov 2009 15:58:24 -0800, Steve Howell wrote: On Nov 18, 2:22 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Wed, 18 Nov 2009 02:06:49 -0800, Steve Howell wrote: P.S. The

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

2009-11-18 Thread Steven D'Aprano
On Wed, 18 Nov 2009 17:14:27 -0800, Steve Howell wrote: In my rewritten code, here is the smell: dispatches = { 'dict': _dict, 'list': _list, 'attr': _attr, 'key': _key, 'as': _as, 'call': _call,

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

2009-11-18 Thread Steve Howell
On Nov 18, 5:42 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Wed, 18 Nov 2009 17:14:27 -0800, Steve Howell wrote: In my rewritten code, here is the smell:     dispatches = {             'dict': _dict,             'list': _list,             'attr': _attr,        

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

2009-11-17 Thread sjm
On Nov 16, 12:54 pm, Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: snip Does anybody know a language with this kind of syntax for ifThenElseEndif? Modern-day COBOL: IF some-condition do-something ELSE do-something-else END-IF. The period is also meaningful as a

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

2009-11-17 Thread nn
On Nov 16, 11:54 am, Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: This is a question for the language mavens that I know hang out here. It is not Python related, except that recent comparisons of Python to Google's new Go language brought it to mind. NOTE that this is *not* a suggestion

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

2009-11-17 Thread steven.oldner
Along the COBOl line is ABAP, the 4gl language from SAP. If today = 'Mon'. message 'oh boy'. elseif today = 'Wed'. message 'Hump day'. elseif today = 'Fri'. message 'TGIF'. else. message 'get to work'. endif. The period is the statement teminator. Indentation and separte lines are just

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

2009-11-17 Thread TerryP
On Nov 16, 4:54 pm, Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: This is a question for the language mavens that I know hang out here. It is not Python related, except that recent comparisons of Python to Google's new Go language brought it to mind. NOTE that this is *not* a suggestion to

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

2009-11-17 Thread Dotan Cohen
2009/11/16 Steve Ferg steve.ferg.bitbuc...@gmail.com: This is a question for the language mavens that I know hang out here. It is not Python related, except that recent comparisons of Python to Google's new Go language brought it to mind. NOTE that this is *not* a suggestion to change Python.

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

2009-11-16 Thread Steve Ferg
This is a question for the language mavens that I know hang out here. It is not Python related, except that recent comparisons of Python to Google's new Go language brought it to mind. NOTE that this is *not* a suggestion to change Python. I like Python just the way it is. I'm just curious

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

2009-11-16 Thread Robin Becker
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

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

2009-11-16 Thread James Harris
On 16 Nov, 16:54, Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: This is a question for the language mavens that I know hang out here. It is not Python related, except that recent comparisons of Python to Google's new Go language brought it to mind. NOTE that this is *not* a suggestion to

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

2009-11-16 Thread Adrian Cherry
Steve Ferg steve.ferg.bitbuc...@gmail.com wrote in news:ff92db5b-9cb0-4a72-b339-2c5ac02fb...@p36g2000vbn.googlegro ups.com: This is a question for the language mavens that I know hang out here. It is not Python related, except that recent comparisons of Python to Google's new Go language

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

2009-11-16 Thread MRAB
Steve Ferg wrote: This is a question for the language mavens that I know hang out here. It is not Python related, except that recent comparisons of Python to Google's new Go language brought it to mind. NOTE that this is *not* a suggestion to change Python. I like Python just the way it is.

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

2009-11-16 Thread Robin Becker
Robin Becker wrote: ... 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 ~: $ I meant to say that since sh uses this construct it cannot be too bad as a language construct since the world

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

2009-11-16 Thread Nobody
On Mon, 16 Nov 2009 08:54:28 -0800, Steve Ferg wrote: For a long time I've wondered why languages still use blocks (delimited by do/end, begin/end, { } , etc.) in ifThenElse statements. I've often thought that a language with this kind of block-free syntax would be nice and intuitive:

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

2009-11-16 Thread MRAB
Nobody wrote: On Mon, 16 Nov 2009 08:54:28 -0800, Steve Ferg wrote: For a long time I've wondered why languages still use blocks (delimited by do/end, begin/end, { } , etc.) in ifThenElse statements. I've often thought that a language with this kind of block-free syntax would be nice and

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

2009-11-16 Thread Chris Rebert
On Mon, Nov 16, 2009 at 8:54 AM, Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: This is a question for the language mavens that I know hang out here. It is not Python related, except that recent comparisons of Python to Google's new Go language brought it to mind. NOTE that this is *not* a

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

2009-11-16 Thread r
On Nov 16, 10:54 am, Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: 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

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

2009-11-16 Thread Edward A. Falk
In article ff92db5b-9cb0-4a72-b339-2c5ac02fb...@p36g2000vbn.googlegroups.com, Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: 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

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

2009-11-16 Thread Robert Kern
On 2009-11-16 14:40 PM, Edward A. Falk wrote: In articleff92db5b-9cb0-4a72-b339-2c5ac02fb...@p36g2000vbn.googlegroups.com, Steve Fergsteve.ferg.bitbuc...@gmail.com wrote: I've often thought that a language with this kind of block-free syntax would be nice and intuitive: ifcondition then

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

2009-11-16 Thread Barry W Brown
On Nov 16, 10:54 am, Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: This is a question for the language mavens that I know hang out here. It is not Python related, except that recent comparisons of Python to Google's new Go language brought it to mind. NOTE that this is *not* a suggestion

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

2009-11-16 Thread Erik Max Francis
r wrote: On Nov 16, 10:54 am, Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: 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

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

2009-11-16 Thread Erik Max Francis
Steve Ferg wrote: 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. Obviously, you

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

2009-11-16 Thread alex23
Steve Ferg steve.ferg.bitbuc...@gmail.com wrote: Does anybody know a language with this kind of syntax for ifThenElseEndif? VBScript. Is there any particular reason why this might be a *bad* language- design idea? VBScript. -- http://mail.python.org/mailman/listinfo/python-list