Python syntax in Lisp and Scheme
Terry Reedy
tjreedy at udel.edu
Tue Oct 14 12:02:36 EDT 2003
<prunesquallor at comcast.net> wrote in message
news:8yno1dvi.fsf at comcast.net...
> I disagree. This:
>
> (map 'list (lambda (x) (+ x offset)) some-list)
>
> is clearer than this:
>
> (flet ((add-offset (x) (+ x offset)))
> (map 'list #'add-offset some-list))
I agree for this example (and for the Python equivalent). But if the
function definition is several lines, then I prefer to have it defined
first so that the map remains a mind-bite-sized chunk.
TJR
More information about the Python-list
mailing list