Python syntax in Lisp and Scheme

David Mertz mertz at gnosis.cx
Tue Oct 14 01:26:54 EDT 2003


Matthew Danish <mdanish at andrew.cmu.edu> wrote previously:
|On Wed, Oct 08, 2003 at 03:59:19PM -0400, David Mertz wrote:
|> |Come on.  Haskell has a nice type system.  Python is an application of
|> |Greespun's Tenth Rule of programming.
|> Btw. This is more nonsense.  HOFs are not a special Lisp thing.  Haskell
|> does them much better, for example... and so does Python.

|Wow.  The language with the limited lambda form, whose Creator regrets
|including in the language, is ... better ... at HOFs?
|You must be smoking something really good.

I guess a much better saying than Greenspun's would be something like:
"Those who know only Lisp are doomed to repeat it (whenver they look at
another language)."  It does a better job of getting at the actual
dynamic.

People who know something about languages that are NOT Lisp know that
there is EXACTLY ZERO relation between lambda forms and HOFs. Well, OK,
I guess you couldn't have playful Y combinators if every function has a
name... but there's little loss there.

In point of fact, Python could completely eliminate the operator
'lambda', and remain exactly as useful for HOFs. Some Pythonistas seem
to want this, and it might well happen in Python3000.  It makes no
difference... the alpha and omega of HOFs is that functions are first
class objects that can be passed and returned.  Whether they happen to
have names is utterly irrelevant, anonymity is nothing special.

Haskell could probably get rid of anonymous functions even more easily.
It won't, there's no sentiment for that among Haskell programmers.  But
there is not conceptual problem in Haskell with replacing every lambda
(more nicely spelled "\" in that language) with a 'let' or 'where'.

Yours, David...

--
 mertz@  _/_/_/_/ THIS MESSAGE WAS BROUGHT TO YOU BY: \_\_\_\_    n o
gnosis  _/_/             Postmodern Enterprises            \_\_
.cx    _/_/                                                 \_\_  d o
      _/_/_/ IN A WORLD W/O WALLS, THERE WOULD BE NO GATES \_\_\_ z e






More information about the Python-list mailing list