gcl-devel
[Top][All Lists]
Advanced

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

Re: gcl, mformat and *error-output*


From: Camm Maguire
Subject: Re: gcl, mformat and *error-output*
Date: Sat, 09 Mar 2024 12:03:15 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Greetings, and thanks for your report!

This is a bug in 2.6 in which write-char used by maxima mformat writes
directly to the stream in place of the standard pretty printing
operations invoked, say, by format.  This is fixed in the development
series 2.7.0, though it is still experimental.  Currently 2.7.0 builds
maxima yielding testsuite performace within a few percent of 2.6, but
this still needs improvement.  If you file a bug at savannah I'll try to
see if there is a fix which can go into 2.6.15.

Take care,

Leo Butler <leo.butler@umanitoba.ca> writes:

> (I posted this to maxima-discuss yesterday, but have not had a reaction,
> so I am re-posting here. This bug can be reproduced with the current
> Maxima+GCL build in Debian testing.)
>
>
> I am trying to figure out what is causing a vexing bug involving GCL,
> MFORMAT and *ERROR-OUTPUT*.
>
> Consider a stripped-down definition of MY-ERROR-FN:
>
> MAXIMA> (defun my-error-fn (sstring &rest l)
>        (let ((*standard-output* *error-output*))
>            (mformat t "~a" sstring)
>          (fresh-line *standard-output*)))
>
> The return value of MY-ERROR-FN is T if FRESH-LINE prints a newline and
> NIL if not.
>
> Here it is with the default value of *ERROR-OUTPUT*:
>
> MAXIMA> (my-error-fn "An error occurred.")
> An error occurred.
> NIL
>
> That is a bug, FRESH-LINE should have inserted a newline. What is weird
> is that if MFORMAT is replaced by FORMAT, then FRESH-LINE works as
> expected. I cannot figure out what MFORMAT is doing that tickles this
> bug. Note that this is specific to GCL (tested with v2.6.14).
>
> ----
>
> Here are two good cases, where FRESH-LINE works correctly.
>
> MAXIMA> (setf *error-output* *standard-output* )
>
> #<synonym stream to *TERMINAL-IO*>
>
> MAXIMA> (my-error-fn "An error occurred.")
> An error occurred.
> T
>
>
> MAXIMA> (setf *error-output* (make-string-output-stream ))
>
> #<string-output stream 000000000257bc18>
> MAXIMA> (my-error-fn "An error occurred.")
>
> T
> MAXIMA> (get-output-stream-string *error-output*)
>
> "An error occurred.
> "
>
> TIA,
> Leo
>
>
>
>
>

-- 
Camm Maguire                                        camm@maguirefamily.org
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah



reply via email to

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