For these reasons I think gensyms would be necessary too.
What would you like to see in uLisp in 2023?
Very true!
Here is a good example the first post by Rainer Joswig covers it well.
I donât think Lisp stores all past gensymâd symbols. Theyâre free to be garbage collected but it does increment a gensym forming counter when making them which uses that global counter to make the next gensym.
Now if the gensym C counter is very small for uLisp (byte?), perhaps it attempts to fill old holes before incrementing. I think technically theyâre not to be reused but uLisp has small footprint needs. Also, the default gensym would probably work. The optional prefix is for the programmer but Iâd imagine it creates yet another lookup table.
Didnât mean to open a can of worms!
Up to you of course. :)
On the other hand, perhaps I already have (gensym) :)
This will not conflict with interned symbols if a user defines âg4â.
At that point it should see it and hop over, generating âg5â.
Even when you delete the old symbol from memory the counter holds until it wraps around (very unlikely).
At that (extreme) point, I believe itâd start filling gaps.
(defvar *gensym-counter* 0)
(defun gensym (&rest prefix)
"Generates new symbol, increments *gensym-counter* until empty is found."
(loop
(let ((new-sym (read-from-string
(concatenate 'string
(or (car prefix) "G")
(string (incf *gensym-counter*))))))
(when (not (boundp new-sym))
(return new-sym)))))
(symbolp (gensym "foo")) ; She's a symbol
(eq (gensym) (gensym)) ; They're unique
Maybe, based on summary of all completed projects, it would be possible to design a framework for a basic nano-satellite?