merits of Lisp vs Python

Steven D'Aprano steve at REMOVE.THIS.cybersource.com.au
Sat Dec 9 22:16:39 EST 2006


On Sat, 09 Dec 2006 14:55:13 -0800, Paul Rubin wrote:

> Steven D'Aprano <steve at REMOVE.THIS.cybersource.com.au> writes:
>> Now, if you want to tell me that, despite all the talk, Lisp coders don't
>> actually create new syntax or mini-languages all that often, that they
>> just use macros as functions, then the question becomes: why do you need
>> macros then if you are just using them as functions? Why not use functions?
> 
> Macros let you write what amounts to functions that don't evaluate
> their arguments.  Think of the endless clpy wars over the ternary
> conditional operator.  
[snip]
> That is trivial to do with a macro

I know that. It was more of a rhetorical question -- Lispers are either
trying to emphasis the radical nature of what you can do with macros, or
understate it and make them seem just like functions. 

> but can't be done with a function.

*shrug* 

You can't get to Sydney from Melbourne via Hobart by bicycle either. You
either change the requirements (why does it have to be by bicycle?) or the
path (why go through Hobart?) or change the infrastructure (build a long,
long bridge connecting Hobart to the mainland). That's three tactics for
solving the problem of "go from Sydney to Melbourne". It is just not true
that the only "correct" solution is to build the bridge.

In the case of the ternary operator, changing the language is like
building the bridge. It's *a* solution. Maybe it is even the best
solution. But it is ludicrous to say that "change the language" is the
only solution. 

(I know you didn't say that -- but so many people seem to think that
adding new syntactic support for their pet feature is the only solution to
their problem, no matter what the problem. Those people would, I imagine,
wet themselves in excitement if Python ever got macros. "Now at last I can
make Python look just like the bastard love-child of Perl and Java!" *wink*)


-- 
Steven.




More information about the Python-list mailing list