This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: difficulty of writing translators


> I agree that using the value as the first parameter is easier.  But
> CLtL2 says on pages 146:

(That is page 138 in my edition.)

But the case most relevant to the discussion is on page 128, and begins:
 
* Any other list whose first element is a symbol (call if f).
  In this case, the call to setf expands into a call to the function
  named by the list (setf f) (see  section 7.1).  The first argument
  is the new value and the remaining arguments are the remaining elements
  of place. This expansion occurs regardless of whether f or (setf f)
  is defined as a function locally, globally, or not at all. 
  For example:
    (setf (f arg1 arg2 ...) newvalue)
  expands into a from with the same effect and value as
    (let ((#:temp1 arg1)  ;Force correct order of evaluation
          (#:temp2 arg2)
          ...
          (#:temp0 newvalue))
     (funcall (function (setf f))
              #:temp0
              #:temp1
              #:temp2 ...))

See http://www.harlequin.com/education/books/HyperSpec/Body/sec_5-1-2-9.html.

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner