From 8d64c2fbada0439da4d4c811a7d08935e4257c9f Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Sun, 18 Dec 2011 14:22:09 +0100 Subject: [PATCH] Avoid using CONSTANTLY before it is defined --- src/lsp/evalmacros.lsp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/lsp/evalmacros.lsp b/src/lsp/evalmacros.lsp index 7b658d566..182496ec1 100644 --- a/src/lsp/evalmacros.lsp +++ b/src/lsp/evalmacros.lsp @@ -18,21 +18,6 @@ If TEST evaluates to NIL, then evaluates FORMs and returns all values of the last FORM. If not, simply returns NIL." `(IF (NOT ,pred) (PROGN ,@body))) -(defmacro defun (&whole whole name vl &body body &aux doc-string) - ;; Documentation in help.lsp - (multiple-value-setq (body doc-string) (remove-documentation body)) - (let* ((function `#'(ext::lambda-block ,name ,vl ,@body)) - (global-function `#'(ext::lambda-block ,name ,vl - (declare (si::c-global)) - ,@body))) - (when *dump-defun-definitions* - (print function) - (setq function `(si::bc-disassemble ,function))) - `(progn - ,(ext:register-with-pde whole `(si::fset ',name ,global-function)) - ,@(si::expand-set-documentation name 'function doc-string) - ',name))) - (defmacro defmacro (&whole whole name vl &body body &aux doc-string) ;; Documentation in help.lsp (multiple-value-bind (function pprint doc-string) @@ -101,6 +86,25 @@ VARIABLE doc and can be retrieved by (DOCUMENTATION 'SYMBOL 'VARIABLE)." (si::register-global ',var))) ',var)) +(defparameter *defun-inline-hook* nil) + +(defmacro defun (&whole whole name vl &body body &environment env &aux doc-string) + ;; Documentation in help.lsp + (multiple-value-setq (body doc-string) (remove-documentation body)) + (let* ((function `#'(ext::lambda-block ,name ,vl ,@body)) + (global-function `#'(ext::lambda-block ,name ,vl + (declare (si::c-global)) + ,@body))) + (when *dump-defun-definitions* + (print function) + (setq function `(si::bc-disassemble ,function))) + `(progn + ,(ext:register-with-pde whole `(si::fset ',name ,global-function)) + ,@(si::expand-set-documentation name 'function doc-string) + ,(let ((hook *defun-inline-hook*)) + (and hook (funcall hook name global-function env))) + ',name))) + ;;; ;;; This is a no-op unless the compiler is installed ;;;