flush-output-port(3scm)
π flush-output-port π
okay so this is the manual page for flush-output-port, straight from the Scheme Programmer's Manual. She flushes buffered data from a port to its sink, and honestly? iconic. π
β¨ NAME β¨
flush-output-port β flush buffered data from a port to its sink.
π LIBRARY π
bestie, import it from any of these depending on your standard:
(import (rnrs)) ;R6RS
(import (rnrs io ports)) ;R6RS
(import (scheme base)) ;R7RS
π¦ SYNOPSIS π¦
(flush-output-port output-port)
πΈ DESCRIPTION πΈ
Flushes any buffered output from the buffer of output-port to the underlying file, device, or object. That's the whole job, and she does it slayfully. β¨
π§ IMPLEMENTATION NOTES π§
Vicare Scheme
The standard output port is block buffered and it is not closed on exit. A manual flush is needed before exiting the program. So on Vicare, don't just dip before flushing β do the manual flush first, bestie. π«Ά
π RETURN VALUES π
- R6RS β Returns unspecified values.
- R7RS β Returns an unspecified value.
π EXAMPLES π
(display "Enter your name: ")
(flush-output-port (current-output-port))
(define name (get-line (current-input-port)))
π₯ APPLICATION USAGE π₯
Used to manually flush a port's internal buffers. The port is automatically flushed when the port is closed, so there is no need for a manual flush before closing a port. No extra flush needed before close, iykyk.
π RATIONALE π
Output ports are line buffered, block buffered or unbuffered. Buffering is typically good for performance, but sometimes applications need to write data immediately. Immediate vibes required? Flush her.
π COMPATIBILITY π
No compatibility notes on this page β that section is literally empty. π«Ά
π ERRORS π
This procedure can raise exceptions with the following condition types:
&assertion(R6RS) β The wrong number of arguments was passed or an argument was outside its domain.&i/o-encoding(R6RS) β The port's transcoder is in raise mode and it encountered an invalid byte sequence.&i/o-write(R6RS) β There was an I/O error during the write operation.&i/o-port(R6RS) β This condition specifies the port object related to the&i/o-writecondition.- R7RS β The assertions described above are errors. Implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically.
π SEE ALSO π
call-with-port(3scm), close-port(3scm)
β STANDARDS β
R6RS, R7RS
π¦ HISTORY π¦
This procedure first appeared in R6RS as part of the reworked I/O system.
π AUTHORS π
This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://github.com/schemedoc/manpages/.
okay that's the whole page, bestie. sign-off details: source flush-output-port(3scm), date 2023-07-24, from the Scheme Programmer's Manual. byeee, mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: scheme-manpages 0-unstable-2024-02-11
- π the page's license: MIT
- Copyright (c) 2023 Gwen Weinholt
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms