/[cmucl]/src/code/extensions.lisp
ViewVC logotype

Diff of /src/code/extensions.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by ram, Fri Feb 8 13:32:27 1991 UTC revision 1.9 by ram, Wed Apr 24 20:30:13 1991 UTC
# Line 305  Line 305 
305  ;;;  ;;;
306  (defmacro once-only (specs &body body)  (defmacro once-only (specs &body body)
307    "Once-Only ({(Var Value-Expression)}*) Form*    "Once-Only ({(Var Value-Expression)}*) Form*
308    Create Let which evaluates each Value-Expression, binding a temporary    Create a Let* which evaluates each Value-Expression, binding a temporary
309    variable to the result, and wrapping the Let around the result of the    variable to the result, and wrapping the Let* around the result of the
310    evaluation of Body.  Within the body, each Var is bound to the corresponding    evaluation of Body.  Within the body, each Var is bound to the corresponding
311    temporary variable.  If the Value-Expression is a constant, then we just pass    temporary variable."
   it through."  
312    (let ((n-binds (gensym))    (let ((n-binds (gensym))
313          (n-temp (gensym)))          (n-temp (gensym)))
314      (collect ((names)      (collect ((names)
# Line 324  Line 323 
323             `(let ((,n-temp (gensym)))             `(let ((,n-temp (gensym)))
324                (,n-binds `(,,n-temp ,,name))                (,n-binds `(,,n-temp ,,name))
325                (setq ,name ,n-temp)))))                (setq ,name ,n-temp)))))
326        `(let ,(names)        `(let* ,(names)
327           (collect ((,n-binds))           (collect ((,n-binds))
328             ,@(temp-binds)             ,@(temp-binds)
329             (list 'let (,n-binds) (progn ,@body)))))))             (list 'let* (,n-binds) (progn ,@body)))))))
330    
331    
332  ;;;; DO-ANONYMOUS:  ;;;; DO-ANONYMOUS:

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.5