From 50fb814fd1ae321a01fc72a04ee33626fc3fc8ad Mon Sep 17 00:00:00 2001 From: Daniel Kochmanski Date: Tue, 13 Feb 2018 13:22:12 +0100 Subject: [PATCH] Accept all valid function names in c::compile Previously we accepted only symbols, now we use si:valid-funciton-name-p predicate to allow (setf foo) as well. --- src/cmp/cmpmain.lsp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cmp/cmpmain.lsp b/src/cmp/cmpmain.lsp index 4dbda4de3..736ab4392 100755 --- a/src/cmp/cmpmain.lsp +++ b/src/cmp/cmpmain.lsp @@ -755,7 +755,7 @@ If NAME is NIL, then the compiled function is not installed but is simply returned as the value of COMPILE. In any case, COMPILE creates temporary files, whose filenames begin with \"gazonk\", which are automatically deleted after compilation." - (unless (symbolp name) (error "~s is not a symbol." name)) + (unless (si:valid-function-name-p name) (error "~s is not a valid function name." name)) (cond ((and supplied-p def) (when (functionp def) @@ -763,11 +763,11 @@ after compilation." (return-from compile def)) (setf def (function-lambda-expression def))) (setq form (if name - `(setf (symbol-function ',name) #',def) + `(setf (fdefinition ',name) #',def) `(set 'GAZONK #',def)))) ((not (fboundp name)) (error "Symbol ~s is unbound." name)) - ((typep (setf def (symbol-function name)) 'standard-generic-function) + ((typep (setf def (fdefinition name)) 'standard-generic-function) (warn "COMPILE can not compile generic functions yet") (return-from compile (values def t nil))) ((null (setq form (function-lambda-expression def))) @@ -775,7 +775,7 @@ after compilation." name) (return-from compile (values def t nil))) (t - (setq form `(setf (symbol-function ',name) #',form)))) + (setq form `(setf (fdefinition ',name) #',form)))) (let*((*load-time-values* 'values) ;; Only the value is kept (tmp-names (safe-mkstemp (format nil "TMP:ECL~3,'0x" (incf *gazonk-counter*))))