Python syntax in Lisp and Scheme

Paul Rubin http
Fri Oct 3 18:29:22 EDT 2003


jcb at iteris.com (MetalOne) writes:
> Scheme
> (define vector-fill!
>   (lambda (v x)
>     (let ((n (vector-length v)))
>       (do ((i 0 (+ i 1)))
>           ((= i n))
>           (vector-set! v i x)))))

I think you could write the scheme code like this:

    (define vector-fill! (v x)
      (let ((i 0))
         (while (< i (length v))
            (vector-set! v i x)
            (set! i (1+ i)))))

> I have tried on 3 occassions to become a LISP programmer, based upon
> the constant touting of LISP as a more powerful language and that
> ultimately S-exprs are a better syntax.  Each time, I have been
> stopped because the S-expr syntax makes we want to vomit.

If you go crazy with macros, lisp gets confusing, that's for sure.




More information about the Python-list mailing list