/[cmucl]/src/compiler/macros.lisp
ViewVC logotype

Diff of /src/compiler/macros.lisp

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

revision 1.20 by ram, Thu Jan 3 13:11:41 1991 UTC revision 1.21 by ram, Sun Jan 13 23:35:01 1991 UTC
# Line 384  Line 384 
384  ;;; automatically create the result lambda.  ;;; automatically create the result lambda.
385  ;;;  ;;;
386  (defmacro deftransform (name (lambda-list &optional (arg-types '*) (result-type '*)  (defmacro deftransform (name (lambda-list &optional (arg-types '*) (result-type '*)
387                                            &key result policy node defun-only)                                            &key result policy node defun-only
388                                              eval-name)
389                               &body body)                               &body body)
390    "Deftransform Name (Lambda-List [Arg-Types] [Result-Type] {Key Value}*)    "Deftransform Name (Lambda-List [Arg-Types] [Result-Type] {Key Value}*)
391                 Declaration* Form*                 Declaration* Form*
# Line 428  Line 429 
429      :Policy - A form which is supplied to the Policy macro to determine whether      :Policy - A form which is supplied to the Policy macro to determine whether
430                this transformation is appropriate.  If the result is false, then                this transformation is appropriate.  If the result is false, then
431                the transform automatically passes.                the transform automatically passes.
432        :Eval-Name
433                - The name is actually a form to be evaluated.  Useful for getting
434                  closures that transform similar functions.
435      :Defun-Only      :Defun-Only
436              - Don't actually instantiate a transform, instead just DEFUN              - Don't actually instantiate a transform, instead just DEFUN
437                Name with the specified transform definition function.  This may                Name with the specified transform definition function.  This may
438                be later instantiated with %Deftransform."                be later instantiated with %Deftransform."
439    
440      (when (and eval-name defun-only)
441        (error "Can't specify both DEFUN-ONLY and EVAL-NAME."))
442    (let ((n-args (gensym))    (let ((n-args (gensym))
443          (n-node (or node (gensym)))          (n-node (or node (gensym)))
444          (n-decls (gensym))          (n-decls (gensym))
# Line 461  Line 467 
467          (if defun-only          (if defun-only
468              `(defun ,name ,@stuff)              `(defun ,name ,@stuff)
469              `(%deftransform              `(%deftransform
470                ',name                ,(if eval-name name `',name)
471                '(function ,arg-types ,result-type)                '(function ,arg-types ,result-type)
472                #'(lambda ,@stuff)))))))                #'(lambda ,@stuff)))))))
473    

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.5