Terry Reedy wrote:
> "Nick Coghlan" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> Hell no. If I want to write a real function, I already have perfectly 
>> good
>> syntax for that in the form of a def statement. I want to *increase* the
>> conceptual (and pedagogical) difference between deferred expressions and 
>> real
>> functions, not reduce it.
> 
> Mathematically, a function is a function.  Expressions and statements are 
> two syntaxes for composing functions to create/define new functions.  A few 
> languages use just one or the other.  Python intentionally uses both.  But 
> I think making an even bigger deal of surface syntax is exactly the wrong 
> movement, especially pedagogically.

I guess I misstated myself slightly - I've previously advocated re-using the 
'def' keyword, so there are obviously parallels I want to emphasize.

I guess my point is that expressions are appropriate sometimes, functions are 
appropriate other times, and it *is* possible to give reasonably simple 
guidelines as to which one is most appropriate when (one consumer->deferred 
expression, multiple consumers->named function).

I see it as similar to the choice of whether to use a generator function or 
generator expression in a given situation.

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to