Why don't people like lisp?

Adam Warner usenet at consulting.net.nz
Sun Oct 19 03:22:13 EDT 2003


Hi David Mertz,

> Sure... but just imagine how badly matched my parentheses would have
> been had I attempted to post Lisp code.

I suspect you pasted in validly formatted Python code:

def categorize_compose(filters, iter):
    results = tuple([[] for _ in len(filters)])
    for x in iter:
        results[compose(filters)(x)].append(x)
    return results

Before proceeding to indent it for display:

....def categorize_compose(filters, iter):
....    results = tuple([[] for _ in len(filters)])
....    for x in iter:
....        results[compose(filters)(x)].append(x)
    return results

Making this mistake will not affect the semantics of Lisp code. If you had
attempted to indent valid Lisp code you could not have made the same
mistake.

Even if you ultimately remember to indent everything correctly for display
you are still changing the semantics of the program with every interim
indentation change (and an interim failure could leave you with invalid
code). A related issue is moving a block of Python code within a program
and having to fix indentation of every line in the block to avoid changing
its original semantics.

Lisp parentheses combined with form analysis provide enough information to
automatically reformat any arbitrary block of code. Lisp's parentheses and
syntax are one of Lisp's greatest assets (and they also support effortless
code generation). One could say Lisp's syntax is essential for achieving
these aims. One could also say Python's syntax is essential for achieving
its aesthetic aims and markedly distinguishing it from other programming
languages.

Regards,
Adam




More information about the Python-list mailing list