Why is Python popular, while Lisp and Scheme aren't?

Jens Axel Søgaard usenet at jasoegaard.dk
Sun Nov 10 08:23:15 EST 2002


Pascal Costanza wrote:
> Rocco Moretti wrote:
>> "Johannes Grødem <johs+n at ifi.uio.no> wrote in message 
>> news:<lzznsipz4s.fsf at unity.copyleft.no>...
>>
>>> Because Lisp has a powerful macro system, it is actually possible to
>>> have an infix-macro, which lets you use infix-syntax.  And you can
>>> write macros to support all sorts of weird syntax, if you want.
>>
>>
>> I've heard this argument a number of times, and have never really
>> bought it. To me it seems equivalent to saying "Because (Brainf*ck/
>> Intercal/ Unlambda/ Malbourge /etc) are Turing Complete, you can write
>> any program in them." Sure, you *can*, but why bother?
> 
> 
> ...because macros in Common Lisp allow you to do extremely powerful 
> things and write very compact code.

[A very nice example]

A frequently asked question for new comers to Python is "Why did
you leave out my favorite loop construction?". I mean, there are always 
someone that likes do-while better than repeat-until and vice versa.

In a language with macros such as CommonLisp or Scheme one can use 
macros to make new control structures. One example is the "missing" 
loop. The point is that the programmer can add to the power of the 
language without asking Guido first.

Another example is pattern matching. Scheme is born without, but using a 
library written using macros one can use pattern matching the SML-way.

To some extent this objection the objection "There are no macros" has 
the same cause as the the reaction to the displine-and-bondage language 
Pascal. Is it the language designer or the programmer that has the final 
word?

Is new control structures useful? To a newcomer to the world of macros 
the answer seems to be no. But once you have gotten uses to the idea, 
one an amazing amount of uses. Pascal Constanzas example showed one use.




More information about the Python-list mailing list