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
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
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
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;
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) *
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
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
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
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
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.
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
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
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
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
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
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
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:
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
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,
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,
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
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
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
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
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.
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
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
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
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
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.
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
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:
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
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
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
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
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
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
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
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
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
41 matches
Mail list logo