From 0407b9697c8a31ea9b773942b250e3bf9c0cc0e2 Mon Sep 17 00:00:00 2001 From: Marius Gerbershagen Date: Sat, 23 Mar 2019 17:34:47 +0100 Subject: [PATCH] defstruct: fix print-object and print-function options for lambdas Bug introduced in commit ba573abf9eb97820e3b958792e200f40a1c3fa8d. --- src/lsp/defstruct.lsp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lsp/defstruct.lsp b/src/lsp/defstruct.lsp index abbb55dad..115fb13b6 100644 --- a/src/lsp/defstruct.lsp +++ b/src/lsp/defstruct.lsp @@ -450,8 +450,12 @@ as a STRUCTURE doc and can be retrieved by (documentation 'NAME 'structure)." (setq include (cdar os)) (unless (get-sysprop v 'IS-A-STRUCTURE) (error "~S is an illegal included structure." v))) - (:PRINT-FUNCTION (setq print-function v)) - (:PRINT-OBJECT (setq print-object v)) + (:PRINT-FUNCTION (setq print-function (if (symbolp v) + `(quote ,v) + `(function ,v)))) + (:PRINT-OBJECT (setq print-object (if (symbolp v) + `(quote ,v) + `(function ,v)))) (:TYPE (setq type v)) (:INITIAL-OFFSET (setq initial-offset v)) (t (error "~S is an illegal defstruct option." o)))) @@ -562,7 +566,7 @@ as a STRUCTURE doc and can be retrieved by (documentation 'NAME 'structure)." ;; (let ((core `(define-structure ',name ',conc-name ',type ',named ',slots ',slot-descriptions ',copier ',include - ',print-function ',print-object ',constructors + ,print-function ,print-object ',constructors ',offset ',name-offset ',documentation ',predicate)) (constructors (mapcar #'(lambda (constructor)