Antsan
2/23/2016 2:39:00 PM
Why is it a misfeature?
If bindings were first-class objects this wouldn't be a problem at all.
So, if you can make bindings fist class objects in Lisp you'd be able to share
a place across variables.
Didn't Doug Hoyte do this in Let Over Lambda via lambdas?
Yeah, this is the (incomplete and incorrect) code:
(defmacro! pointer-& (obj)
`(lambda (&optional (,g!set ',g!temp))
(if (eq ,g!set ',g!temp)
,obj
(setf ,obj ,g!set))))
(defun pointer-* (addr)
(funcall addr))
(defsetf pointer* (addr)
(val)
`(funcall ,addr ,val))
(defsetf pointer-& (addr)
(val)
`(setf (pointer-* ,addr)
,val))
Indirection indeed.