Immediate output instead of waiting for the script to finish

Discussion of Common Lisp
Post Reply
Lispeth
Posts: 25
Joined: Wed May 13, 2015 8:33 am

Immediate output instead of waiting for the script to finish

Post by Lispeth » Thu Mar 17, 2016 6:15 am

Hi, everyone,

as I'm currently writing a long(ish) command-line tool in SBCL, I noticed that all output is queued until the script finishes or signals an unhandled condition. I'd prefer to see some "progress" though. Is there a way to force immediate output of (print)s and (format)s?

Goheeca
Posts: 271
Joined: Thu May 10, 2012 12:54 pm
Contact:

Re: Immediate output instead of waiting for the script to fi

Post by Goheeca » Thu Mar 17, 2016 6:49 am

There are functions for a buffer manipulation, force-output is probably what are you looking for.
cl-2dsyntax is my attempt to create a Python-like reader. My mirror of CLHS (and the dark themed version). Temporary mirrors of aferomentioned: CLHS and a dark version.

Lispeth
Posts: 25
Joined: Wed May 13, 2015 8:33 am

Re: Immediate output instead of waiting for the script to fi

Post by Lispeth » Thu Mar 17, 2016 7:34 am

Looks exactly like what I want, thanks!

But I'm not quite sure about the difference between force-output and finish-output yet. Am I right that finish-output resets the buffer while force-output does not?

Goheeca
Posts: 271
Joined: Thu May 10, 2012 12:54 pm
Contact:

Re: Immediate output instead of waiting for the script to fi

Post by Goheeca » Fri Mar 18, 2016 12:29 am

finish-output is a blocking call and force-output is a non-blocking call.
cl-2dsyntax is my attempt to create a Python-like reader. My mirror of CLHS (and the dark themed version). Temporary mirrors of aferomentioned: CLHS and a dark version.


Post Reply