Re: maxima's private "let"



   From: Raymond Toy <raymond.toy at ericsson>
   
   I'm mistaken.  cmucl's letf doesn't do destructuring.  In fact, I'm
   not really sure what letf does.  It seems it's like let, but the
   variable is some kind of generalized place, instead of just variable.

FYI, the classic definition of letf is to provide something like this:

 (letf ((<place> <form>)) . <body>)
 ==>
 (let ((#:g1000 <place>))
   (unwind-protect
       (progn (setf <place> <form>)
              . <body>)
     (setf <place> #:g1000)))

except with the usual setf guarantee that subforms of <place> are
eveluated only once.

But beware a hidden semantic problem with any such binding forms when
multiprocessing (threading) is involved.  Binding of a lexical
variable is not generally visible to other threads.  Multiprocessing
is generally definesd such that special bindings on one thread are not
visible on other threads.  But letf bindings of slot of objects in the
heap are intrinsically global and will be seen by all threads.
Furthermore, if multiple threads bind and unbind the same location
asynchronously, grave disorder can result.

Maxima doesn't do multiprocessing, of course, but it _might_ when some
bright young person completes the all-things-to-all-people user
interface.  You need to make sure that these binding forms never bind
anything that might be visible on smoe other thread.  letf can be
dangerous as a general tool.