I am asking this about the relationship between lexical variables
and symbol macros, not whether it is any good as an implementation
technique (which it may or may not be).
Could LET (of lexical variables) be implemented by something like:
(let ((x 'init-x)
(y 'init-y))
...)
->
(with-allocated-bindings (b 2) ;number of bindings
(setf (access-binding b 0) 'init-x
(access-binding b 1) 'init-y)
(symbol-macrolet ((x (access-binding b 0))
(y (access-binding b 1)))
...))
where WITH-ALLOCATED-BINDINGS and ACCESS-BINDING are special forms
doing the obvious thing.
(B would have dynamic extent if the Lisp processor can determine
that the bindings have dynamic extent, otherwise B would be
allocated on the heap.)
On the other hand, I can see no way to implement SYMBOL-MACROLET
on top of LET in an analogous way.
Thanks,
Vassil.
Vassil Nikolov <········@poboxes.com> www.poboxes.com/vnikolov
(You may want to cc your posting to me if I _have_ to see it.)
LEGEMANVALEMFVTVTVM (Ancient Roman programmers' adage.)
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own