News for hackers. Stuff that matters.
Re:Anarki – Community-managed fork of the Arc dialect of Lisp by kazinator on Sunday July 15, 2018 @11:03PM (#17538474)
Where your comment falls down is that in a Lisp-1, every let is also a flet.

Also, of course, you must use gensyms for any locally bound identifier, whether it is a let or flet. Nobody said that Lisp-2 allows for labels and flets without having to use gensyms; nobody in their right mind is going to lexically bind identifiers in macro-generated code that don't use gensymed names (other than in cases when there is no possible capture).

Lisp-2 addresses (in a good-enough-beats-perfect way) the following problem: the programmer's code wrongly capturing references that the macro would like to use.

The macro wants to generate some (foo ...) call to a function in the global environment. But, oops, in a Lisp-1, a user's local variable foo takes this. In a Lisp-1, the user would have to have a local function by that name.

If global functions have reasonably descriptive names, and local functions are used sparingly, the potential for a clash is low.

We can have a warning when a local function shadows a global one; it won't be too much of a nuisance since global functiions tend to use descriptive names, and local functions are relatively rare compared to local variables.

There are no comments on this comment yet.