[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] bug in write-to-string

From: root
Subject: Re: [Axiom-developer] bug in write-to-string
Date: Sun, 18 May 2003 17:17:33 -0400

In GCL 2.5.2 there is a bug that causes "Won't parse" messages in
the interpreter. A function called form2LispString in br-util.boot.pamphlet
calls STRINGIMAGE which is defined to be write-to-string in Common Lisp.

Inserting the vertical bar "|" escape character in strings breaks the
parsing within Axiom. Attached is the message to the GCL-devel list as
well as a patch file for vmlisp.lisp.pamphlet

--- vmlisp.lisp.pamphlet~       Sun Nov 17 14:14:45 2002
+++ vmlisp.lisp.pamphlet        Sun May 18 16:24:37 2003
@@ -8,6 +8,30 @@
+\section{The StringImage Fix}
+In GCL 2.5 there is a bug in the write-to-string function.
+It should respect *print-escape* but it does not. That is,
+In GCL 2.4.1:
+(setq *print-escape* nil)
+(write-to-string '|a|) ==> "a"
+In GCL 2.5:
+(setq *print-escape* nil)
+(write-to-string '|a|) ==> "|a|"
+The form2LispString function uses stringimage and fails.
+The princ-to-string function assumes *print-escape* is nil
+and works properly.
+<<stringimage fix>>=
+;(define-function 'prin2cvec #'write-to-string)
+(define-function 'prin2cvec #'princ-to-string)
+;(define-function 'stringimage #'write-to-string)
+(define-function 'stringimage #'princ-to-string)
 ; See LICENSE.AXIOM for Copyright
@@ -1491,8 +1515,7 @@
 ; 24.0 Printing
-(define-function 'prin2cvec #'write-to-string)
-(define-function 'stringimage #'write-to-string)
+<<stringimage fix>>
 (define-function 'printexp #'princ)
 (define-function 'prin0  #'prin1)

In GCL 2.4.1:

(setq *print-escape* nil)
(write-to-string '|a|) ==> "a"

in GCL 2.5

(setq *print-escape* nil)
(write-to-string '|a|) ==> "|a|"

It appears that write-to-string is ignoring *print-escape*
in the latest version. This is a bug.

This causes the "Won't parse" messages in the latest port.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]