[ prog / sol / mona ]

prog


Marvin Minsky - The Beauty of the Lisp Language [Part 2]

5 2020-10-14 23:42

>>4

It does not work just fine.

You're not making LISP case-sensitive there. You're forcing the reader to invert the case of every character at read time. This creates the illusion of case sensitivity while silently breaking things in non-intuitive.

For example, readline tab completion is broken by using :invert. And if someone else wrote code using the default :upcase and used any capital letters that code will be broken if it is run in an environment using :invert.

An example:

(defvar openFuture 't)                      ; works fine
(setf (readtable-case *readtable*) :invert) ; no problems yet
(format 't "openFuture == ~a" openFuture)   ; variable openFuture does not exist

What actually happens there is the first line creates a variable called OPENFUTURE not openFuture. Then we switch to :invert mode. Then the third line tried to print a variable called OPENfUTURE.

The supposed freedom of LISP here actually creates an environment in which everyone is forced to pretend the language is case insensitive.

24


VIP:

do not edit these