Ask HN: If you were designing Common Lisp today, what would you change?
I developed a language called TXR Lisp, which has ties with Common Lisp in many areas. If you look at the reference manual, which is conveniently one giant manual page available in HTML form, there are numerous dialect notes that mention ANSI Common Lisp; a chunk of that would likely be things I might change in Common Lisp.<p>Some things I would fix without changing Common Lisp:<p>* redefine &quot;binding&quot; as being an association between a symbol and a location.<p>* I&#x27;d make (setq x y) have a predictable, documented effect when x is not a defined variable. It would cause <i>x</i> to be bound to its value cell, and place the value of <i>y</i> into that cell, and that would be the same as (setf (symbol-value &#x27;x) y).<p>* pick up some outstanding issues and resolve them, like this one: during a dynamic control transfer, an exit point is identified for that control transfer and then unwinding takes place. It is not specified in CL whether the intermediate exit points (the ones not selected for the transfer which are being skipped) are torn down before the control transfer takes place, or torn down as-you-go during unwinding.   I&#x27;d fix that as being tear-down-as-you-go.  This affects situations when an unwind-protect intercepts a control transfer and then tries to initiate a new one to a different exit point.<p>* I&#x27;d fix the order of evaluation of a function binding relative to the arguments. We know that in (f x y z), the x y z are evaluated in left to right order, if f is a function. However, we don&#x27;t know whether the f binding is resolved before or after the arguments. I&#x27;d pick one order and require it; probably before the arguments, though that requires the longest possible temporary storage.  Obviously there are situations in which the binding isn&#x27;t evaluated each time the function is called, like when it has been inlined.<p>* loop would support application-defined clauses.<p>* structs and CLOS would be integrated together; conditions would be CLOS instances.<p>* in the area of pathnames, I would have the language specify precisely how POSIX and Windows paths correspond to pathname objects. Every implementation would have to follow that. For instance, it couldn&#x27;t be that one implementation sees &quot;foo.c&quot; has having a type &quot;c&quot;, and another one doesn&#x27;t. Everything would be specified down to what happens with double slashes, and trailing slashes.<p>* string literals would support escape sequences for special characters. Also, Unicode would be required. Implementations would have to support UTF-8 code.<p>* string literals would support a way of splitting across multiple lines, such that the reader eats the leading indentation. Thus, the <i>format</i> function wouldn&#x27;t need a hack for this.<p>* FFI would be in the language.