[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-devel
Subject:    Re: [Sbcl-devel] [Sbcl-bugs] force-output
From:       Stas Boukarev <stassats () gmail ! com>
Date:       2023-07-31 14:07:43
Message-ID: CAF63=13fqfdHDZxH-j2b--dDQH-HcjPZi=-a87Jfq6eDSk0aLw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


For format t you need just one (force-output) or (finish-output).

On Mon, Jul 31, 2023 at 4:30 AM Robert Boyer <robertstephenboyer@gmail.com>
wrote:

> You may regard this following as merely a stupid joke by an old fool, and
> you
> are probably right.
>
> I have the experience that force-output does not work for me as it
> should.  Sometimes output
> comes out of order even though the outputs were followed by force-output.
> Probably I
> am just too dumb to know how to call force-output on the right thing.  But
> the following
> code seems to work.   It covers all bases I can think of.
>
> (defmacro our-format-t (&rest rest)
>   `(let ((ans (format t ,@ rest)))
>     (force-output t)
>     (force-output nil)
>     (force-output)
>     (force-output *standard-output*)
>     (force-output *error-output*)
>     (force-output *trace-output*)
>      ans))
>
> I use SBCL all the time and I love it.  God bless you all for this great
> system.
>
> Bob
>
> _______________________________________________
> Sbcl-bugs mailing list
> Sbcl-bugs@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sbcl-bugs
>

[Attachment #5 (text/html)]

<div dir="ltr">For format t you need just one  (force-output) or \
(finish-output).</div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Mon, Jul 31, 2023 at 4:30 AM Robert Boyer &lt;<a \
href="mailto:robertstephenboyer@gmail.com">robertstephenboyer@gmail.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div \
dir="ltr"><div>You may regard this following as merely a stupid joke by an old fool, \
and you</div><div>are probably right.</div><div><br></div><div>I have the experience \
that force-output does not work for me as it should.   Sometimes \
output</div><div>comes out of order even though the outputs were followed by \
force-output.   Probably I</div><div>am just too dumb to know how to call \
force-output on the right thing.   But the following</div><div>code seems to work.    \
It  covers all bases I can think of.</div><div><br></div>(defmacro our-format-t \
(&amp;rest rest)<br>   `(let ((ans (format t ,@ rest)))<br>      (force-output t)     \
<br>      (force-output nil)<br>      (force-output)<br>      (force-output \
*standard-output*)<br>      (force-output *error-output*)<br>      (force-output \
*trace-output*)<br>        ans))<br><div><br></div><div>I use SBCL all the time and I \
love it.   God bless you all for this great \
system.</div><div><br></div><div>Bob</div><div><br></div></div> \
_______________________________________________<br> Sbcl-bugs mailing list<br>
<a href="mailto:Sbcl-bugs@lists.sourceforge.net" \
target="_blank">Sbcl-bugs@lists.sourceforge.net</a><br> <a \
href="https://lists.sourceforge.net/lists/listinfo/sbcl-bugs" rel="noreferrer" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/sbcl-bugs</a><br> \
</blockquote></div>





_______________________________________________
Sbcl-devel mailing list
Sbcl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic