merits of Lisp vs Python
Kaz Kylheku
kkylheku at gmail.com
Tue Dec 12 00:26:15 EST 2006
Paul Rubin wrote:
> André Thieme <address.good.until.2006.dec.22 at justmail.de> writes:
> > > import module
> > > module.function = memoize(module.function)
> >
> > Yes, I mentioned that a bit earlier in this thread (not about the
> > "during runtime" thing).
> > I also said that many macros only save some small bits of code.
> > Your python example contains 4 tokens / brain units.
> > The Lisp version only has 2.
>
> You shouldn't count the import statement, since you'd need the
> equivalent in Lisp as well.
>
> Contrast the much more common
>
> a[i] = b[n]
>
> with
>
> (setf (aref a i) (aref b n))
>
> and the attractions of Python may make more sense.
Actual Lisp session transcript:
[1]> (load "infix.cl")
;; Loading file infix.cl ...
;;;
*************************************************************************
;;; Infix notation for Common Lisp.
;;; Version 1.3 28-JUN-96.
;;; Written by Mark Kantrowitz, CMU School of Computer Science.
;;; Copyright (c) 1993-95. All rights reserved.
;;; May be freely redistributed, provided this notice is left intact.
;;; This software is made available AS IS, without any warranty.
;;;
*************************************************************************
;; Loaded file infix.cl
T
[2]> #i( if x < y then a[i] = b[j] else a[i] = c[j,j] ^^ w )
*** - EVAL: variable X has no value
The following restarts are available:
USE-VALUE :R1 You may input a value to be used instead of X.
STORE-VALUE :R2 You may input a new value for X.
ABORT :R3 ABORT
Break 1 [3]> :a
[4]> (quote #i( if x < y then a[i] = b[j] else a[i] = c[j,j] ^^ w ))
(IF (< X Y) (SETF (AREF A I) (AREF B J))
(SETF (AREF A I) (EXPT (AREF C J J) W)))
In spite of such possibilities, things like this just don't catch on in
Lisp programming. Once people know that they /can/ get it if they want,
they no longer want it.
What doesn't make sense is writing entire language implementations from
scratch in order to experiment with notations.
I think someone may have been working on a Python interface built on
Common Lisp.
Ah, here!
http://trac.common-lisp.net/clpython/wiki/WikiStart
More information about the Python-list
mailing list