stropping [Re: Python syntax in Lisp and Scheme

james anderson james.anderson at setf.de
Thu Oct 9 12:52:24 EDT 2003


Alex Martelli wrote:
> 
> Doug Tolton wrote:
> 
> ...
> >> Btw. This is more nonsense.  HOFs are not a special Lisp thing.  Haskell
> >> does them much better, for example... and so does Python.
> >>
> > What is your basis for that statement?  I personally like the way Lisp
> > does it much better, and I program in both Lisp and Python.  With Python
> >   it's not immediately apparent if you are passing in a simple variable
> > or a HOF.  Whereas in lisp with #' it's immediately obvious that you are
> > receiving or sending a HOF that will potentially alter how the call
> > operates.
> >
> > IMO, that syntax is far clearner.
> 
> I think it's about a single namespace (Scheme, Python, Haskell, ...) vs
> CLisp's dual namespaces.  People get used pretty fast to having every
> object (whether callable or not) "first-class" -- e.g. sendable as an
> argument without any need for stropping or the like.  To you, HOFs may
> feel like special cases needing special syntax that toots horns and
> rings bells; to people used to passing functions as arguments as a way
> of living, that's as syntactically obtrusive as, say, O'CAML's mandate
> that you use +. and not plain + when summing floats rather than ints
> (it's been a couple years since I last studied O'CAML's, so for all I
> know they may have changed that now, but, it IS in the book;-).
> 

it can't really be the #' which is so troubling.

? (defmacro define (name parameters &rest body)
  `(set (defun ,name ,parameters , at body)
        (function ,name)))
DEFINE
? (define lof (a b) (cons a b))
#<Compiled-function LOF #x78467E6>
? (mapcar lof '(1 2 3) '(a s d))
((1 . A) (2 . S) (3 . D))
? 

what is the real issue?

...




More information about the Python-list mailing list