Why don't people like lisp?

Marco Antoniotti marcoxa at cs.nyu.edu
Wed Oct 22 12:03:29 EDT 2003



Andrew Dalke wrote:
> Paul Rubin:
> 
>>You could of course do something similar in Lisp, but normally you'd
>>just use S-expressions instead of concocting your own weird syntax
>>every time you want to build a small language into something.  Then
>>you just use the regular Lisp "read" function and the S-expressions
>>get parsed automatically for you.  Your whole parser becomes just one
>>line of code.
> 
> 
> Ahh, but that's writing the domain language to fit the implementation
> language.

Yes.  The point is that you can do that in CL easily.  Not so in Python.



> The moral equivalent for Python would be to use Python's
> syntax to define a function, which is simple.

CL binds morality with parcticality.  Morality in CL is always practical :)


> Eg, Suppose the domain
> language required that identifiers be labeled with parens, as in a
> chemistry specific language where you might want
>   1-1'-(ethylenediimino)di-2-proponal
> as a native identifier.

	cl-prompt> (symbolp '|1-1'-(ethylenediimino)di-2-proponal|)
	T

In Python there is no equivalent AFAIK, in Java you can to

	"1-1'-(ethylenediimino)di-2-proponal".intern()

to achieve a similar (although not so confortable) effect.
This is no surprise, given that the designers of Java knew Lisp.

Note also that in CL it is extremely easy to make the system accept 
chemical "concentration" variables like the following example

	(equation [CycB] (- k1 (* (+ k2p (*k2pp [Cdh1])) [CycB])))

or (with the INFIX package)

	(equation [CyCB] #I(k1 - (k2p + k2pp * [Cdh1]) * [CycB]))

This is just a few reader macros away (and the use of the INFIX package).

In Python, you always have to com up with you full fledged parser.



Cheers
--
Marco





More information about the Python-list mailing list