current-input-port(3scm)
okay so bestie, welcome to current-input-port(3scm) β a page straight outta the Scheme Programmer's Manual, and it's literally about grabbing the current (default) ports. It's giving tiny-but-mighty, no cap. π
πΈ NAME πΈ
current-input-port,current-output-port,current-error-portβ get the current (default) ports.
π LIBRARY π
(import (rnrs)) ;R6RS
(import (rnrs io ports)) ;R6RS
(import (rnrs io simple)) ;R6RS
(import (scheme r5rs)) ;R7RS
(import (scheme base)) ;R7RS
β¨ SYNOPSIS β¨
(current-input-port)
(current-output-port)
(current-error-port)
π DESCRIPTION π
These return default textual ports for regular input, output, and error output. Normally, these default ports are associated with standard input, standard output, and standard error, respectively.
The return value of current-input-port and current-output-port can be dynamically re-assigned using with-input-from-file(3scm) and with-output-to-file(3scm) respectively.
A port returned by one of these procedures may or may not have an associated transcoder; if it does, the transcoder is implementation-dependent.
R7RS β These procedures are parameter objects, which can be overridden with parameterize(7scm).
π οΈ IMPLEMENTATION NOTES π οΈ
Standard input, output, and error ports are concepts in general purpose operating systems. The implementation should hook these ports up to whatever standard I/O mechanism is provided by the operating system, if any.
π The error port should usually be unbuffered so that no output is lost if the program exits unexpectedly. iykyk.
π RETURN VALUES π
These procedures return a single value; a port. β
π§ͺ EXAMPLES π§ͺ
(display "There was an error.0 (current-error-port))
π«Ά COMPATIBILITY π«Ά
R7RS defines these procedures as parameters. They are likely to internally be some form of parameters in all implementations, however, because of how with-input-from-file(3scm), etc, works. But one cannot expect to portably use them as parameters outside of R7RS.
π 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.- 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 π
standard-input-port(3scm)parameterize(7scm)with-input-from-file(3scm)
π STANDARDS π
R4RS, IEEE Scheme, R5RS, R6RS, R7RS.
π HISTORY π
The current-error-port procedure first appeared in R6RS. The other procedures are standard since R2RS.
π 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! π
cute little sign-off: this is current-input-port(3scm), dated 2023-02-21, from the Scheme Programmer's Manual β now go forth and read your ports π«Άβ¨
π¦ 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