[Ecls-list] [PATCH RESEND] Fix the value of the print-function depth parameter in defstruct.

Alexander Gavrilov angavrilov at gmail.com
Mon Oct 5 17:52:33 UTC 2009


From the Common Lisp HyperSpec:

  It is implementation-dependent whether <<current-print-depth>>
  is always 0 and *print-level*, if non-nil, is re-bound to
  successively smaller values as printing descends recursively,
  or whether current-print-depth varies in value as printing
  descends recursively and *print-level* remains constant during
  the same traversal.

ECL modifies *print-level*, so the value should be 0. Besides,
that's what is passed by the no-CLOS version of the C code.
---

	This is necessary to make FSet containers print properly.

	- Alexander


 src/lsp/defstruct.lsp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lsp/defstruct.lsp b/src/lsp/defstruct.lsp
index 40f78d9..de01954 100644
--- a/src/lsp/defstruct.lsp
+++ b/src/lsp/defstruct.lsp
@@ -294,7 +294,7 @@
   #+clos
   (when print-function
     (eval `(defmethod print-object ((obj ,name) stream)
-	     (,print-function obj stream *print-level*))))
+	     (,print-function obj stream 0))))
   #+clos
   (when print-object
     (eval `(defmethod print-object ((obj ,name) stream)
-- 
1.6.3.rc3.12.gb7937





More information about the ecl-devel mailing list