+
+;;; helper for LAMBDA-like things, to massage them into a form
+;;; suitable for IR1-CONVERT-LAMBDA.
+;;;
+;;; KLUDGE: We cons up a &REST list here, maybe for no particularly
+;;; good reason. It's probably lost in the noise of all the other
+;;; consing, but it's still inelegant. And we force our called
+;;; functions to do full runtime keyword parsing, ugh. -- CSR,
+;;; 2003-01-25
+(defun ir1-convert-lambdalike (thing &rest args
+ &key (source-name '.anonymous.)
+ debug-name allow-debug-catch-tag)
+ (ecase (car thing)
+ ((lambda) (apply #'ir1-convert-lambda thing args))
+ ((instance-lambda)
+ (let ((res (apply #'ir1-convert-lambda
+ `(lambda ,@(cdr thing)) args)))
+ (setf (getf (functional-plist res) :fin-function) t)
+ res))
+ ((named-lambda)
+ (let ((name (cadr thing)))
+ (if (legal-fun-name-p name)
+ (let ((res (apply #'ir1-convert-lambda `(lambda ,@(cddr thing))
+ :source-name name
+ :debug-name nil
+ args)))
+ (assert-global-function-definition-type name res)
+ res)
+ (apply #'ir1-convert-lambda `(lambda ,@(cddr thing))
+ :debug-name name args))))
+ ((lambda-with-lexenv) (apply #'ir1-convert-inline-lambda thing args))))