I think I found a bug in CLisp's (format) function. In this case,
when there's a newline at the end of the string, it prints it at
the beginning and I've tried it with Lispworks and Lispworks
doesn't do it:
--test.lisp--
(defconstant nl "goodbye
")
(defconstant nonl "goodbye")
(format t "hello") (format t "~a" nl)
(format t "hello") (format t "~a" nonl)
--test.lisp--
CLisp prints this:
hello
goodbye
hellogoodbye
Lispworks prints this (like I was expecting):
hellogoodbye
hellogoodbye
What should I do? Tell them on the mailing list or file
a Sourceforge bug report? Or is it not a bug at all?
I think it's gotta be a bug.
Thanks!
Matt
Matt wrote:
> I think I found a bug in CLisp's (format) function. In this case,
> when there's a newline at the end of the string, it prints it at
> the beginning...
Actually, it's printing both at the beginning and the end.
Matt
Matt wrote:
> Matt wrote:
>> I think I found a bug in CLisp's (format) function. In this case,
>> when there's a newline at the end of the string, it prints it at
>> the beginning...
>
> Actually, it's printing both at the beginning and the end.
I guess the problem is with (princ) not (format). I'm looking at
format.lisp and (format) seems to be calling (princ) for "~a"'s and
(princ) is doing it too. Here's the updated test:
--test.lisp--
(princ "hello") (princ "goodbye
")
(princ "hello") (princ "goodbye")
--test.lisp--
Matt
Matt <·····@invalid.net> writes:
> I think I found a bug in CLisp's (format) function. In this case,
> when there's a newline at the end of the string, it prints it at
> the beginning and I've tried it with Lispworks and Lispworks
> doesn't do it:
>
> --test.lisp--
>
> (defconstant nl "goodbye
> ")
> (defconstant nonl "goodbye")
> (format t "hello") (format t "~a" nl)
> (format t "hello") (format t "~a" nonl)
>
> --test.lisp--
>
> CLisp prints this:
> hello
> goodbye
> hellogoodbye
>
> Lispworks prints this (like I was expecting):
> hellogoodbye
> hellogoodbye
>
>
> What should I do? Tell them on the mailing list or file
> a Sourceforge bug report? Or is it not a bug at all?
> I think it's gotta be a bug.
I think it's a bug that's been reported recently.
You should check it is listed in sourceforge.
--
__Pascal Bourguignon__ http://www.informatimago.com/
"Specifications are for the weak and timid!"
Pascal Bourguignon wrote:
> Matt <·····@invalid.net> writes:
>> What should I do? Tell them on the mailing list or file
>> a Sourceforge bug report? Or is it not a bug at all?
>> I think it's gotta be a bug.
>
> I think it's a bug that's been reported recently.
> You should check it is listed in sourceforge.
Oh, you're right, I should have done that. Sorry about that.
Matt
Matt <·····@invalid.net> writes:
> Pascal Bourguignon wrote:
>> Matt <·····@invalid.net> writes:
>
>>> What should I do? Tell them on the mailing list or file
>>> a Sourceforge bug report? Or is it not a bug at all?
>>> I think it's gotta be a bug.
>> I think it's a bug that's been reported recently.
>> You should check it is listed in sourceforge.
>
> Oh, you're right, I should have done that. Sorry about that.
No problem. Now I think I remember it was said the problem is with the
pretty printer, and disabling it avoids the bug:
[93]> (progn (setf *print-pretty* nil)
(princ "hello") (princ "goodbye
") (princ "hello") (princ "goodbye"))
hellogoodbye
hellogoodbye
"goodbye"
[94]>
this must be commented in the bug report no?
--
__Pascal Bourguignon__ http://www.informatimago.com/
You're always typing.
Well, let's see you ignore my
sitting on your hands.
Pascal Bourguignon wrote:
> Matt <·····@invalid.net> writes:
>
>> Pascal Bourguignon wrote:
>>> Matt <·····@invalid.net> writes:
>>
>>>> What should I do? Tell them on the mailing list or file
>>>> a Sourceforge bug report? Or is it not a bug at all?
>>>> I think it's gotta be a bug.
>>> I think it's a bug that's been reported recently.
>>> You should check it is listed in sourceforge.
>>
>> Oh, you're right, I should have done that. Sorry about that.
>
> No problem. Now I think I remember it was said the problem is with the
> pretty printer, and disabling it avoids the bug:
>
> [93]> (progn (setf *print-pretty* nil)
> (princ "hello") (princ "goodbye
> ") (princ "hello") (princ "goodbye"))
>
> hellogoodbye
> hellogoodbye
> "goodbye"
> [94]>
>
> this must be commented in the bug report no?
Yeah, I got it. Thanks!
Matt