merits of Lisp vs Python

Wolfram Fenske int2k at gmx.net
Sun Dec 10 01:51:01 EST 2006


Paul Rubin <http://phr.cx@NOSPAM.invalid> writes:

> "Wolfram Fenske" <int2k at gmx.net> writes:
>> with a couple of macros.  I. e. if Common Lisp didn't have CLOS, its
>> object system, I could write my own as a library and it would be just
>> as powerful and just as easy to use as the system Common Lisp already
>> provides.  Stuff like this is impossible in other languages.
>
> If Common Lisp didn't have lexically scoped variables (most Lisp
> dialects before Scheme didn't have them) then it would be very
> difficult to add that with macros.

Alex Mizrahi already took care of that one.

> Do you seriously think lexical scoping is the last word in language
> features and that there's now nothing left in other languages that
> can't straightforwardly be done in CL?

No.  My point was more that Lisp is so flexible that it even allows
you to add something as huge as object orientation without requiring a
change to the compiler.  What about Aspect-Oriented Programming, for
example?  For Java, you need a new compiler/preprocessor, for Lisp, it
can be implemented as a library [1].

> Hint: call-with-current-continuation (also known as call/cc).

You're right call/cc is a problem because you basically can't
implement call/cc without having call/cc.  I. e. it requires pervasive
changes to the compiler/interpreter if something like it is not
already in there.  Still, Scheme--also a Lisp--has call/cc and was
probably the first language to implement it.

> I just don't see a non-messy way to simulate Python generators in CL.
> They can be done in Scheme using call/cc though.

Scheme is also a Lisp.  So?

> Take a look sometime at Hughes' paper on "Why Functional Programming
> Matters":
>
>    http://www.math.chalmers.se/~rjmh/Papers/whyfp.html
>
> The examples in it are pretty easy to do in Python or Scheme, but I
> think not so easy in CL.

Anything in particular?  I'd be surprised if the solutions in Scheme
and CL would differ very much because apart from the Lisp-1/Lisp-2
issue and call/cc, Scheme and CL are not that different.


Footnotes:
[1]  <http://common-lisp.net/project/closer/aspectl.html>

--
Wolfram Fenske

A: Yes.
>Q: Are you sure?
>>A: Because it reverses the logical flow of conversation.
>>>Q: Why is top posting frowned upon?




More information about the Python-list mailing list