Python syntax in Lisp and Scheme

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Tue Oct 7 14:01:37 EDT 2003


On Tue, 07 Oct 2003 18:54:41 +0200, james anderson wrote:

>> Three words and a hyphen: Higher-Order Functions.

> is the no advantage to being able to do either - or both - as the
> occasion dictates?

The main disadvantage of macros is that they either force the syntax
to look like Lisp, or the way to present code snippets to macros is
complicated (Template Haskell), or they are as limited as C preprocessor
(which can't examine parameters).

I find the Lisp syntax hardly readable when everything looks alike,
mostly words and parentheses, and when every level of nesting requires
parens. I understand that it's easier to work with by macros, but it's
harder to work with by humans like I.

I have yet to find out whether there can be a macro system I would accept,
and for now I prefer to improve the syntax of HOFs. Smalltalk and Ruby use
anonymous functions a lot (despite being imperative) because they are
aesthetic; in particular a nullary function looks just like a piece of
code in [] or {}. Python's lambda is more rare, perhaps because it looks
worse: a scientific word, body limited to a single expression. Named local
functions are not a sufficient building block for control structures either:
they can't assign to local variables of outer functions.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/





More information about the Python-list mailing list