Node:Writing, Next:, Previous:Reading, Up:Input and Output



27.3 Writing

[Generic procedures for writing to ports.]

get-print-state port Scheme Procedure
scm_get_print_state (port) C Function
Return the print state of the port port. If port has no associated print state, #f is returned.

display obj [port] Scheme Procedure
Send a representation of obj to current-output-port. Optional second arg port specifies an alternative output port. The representation is similar to that produced by write (REFFIXME), the differences being strings are not quoted (and their characters are not escaped), and characters are rendered as if with write-char.

newline [port] Scheme Procedure
scm_newline (port) C Function
Send a newline to port. If port is omitted, send to the current output port.

port-with-print-state port pstate Scheme Procedure
scm_port_with_print_state (port, pstate) C Function
Create a new port which behaves like port, but with an included print state pstate.

print-options-interface [setting] Scheme Procedure
scm_print_options (setting) C Function
Option interface for the print options. Instead of using this procedure directly, use the procedures print-enable, print-disable, print-set! and print-options.

simple-format destination message . args Scheme Procedure
scm_simple_format (destination, message, args) C Function
Write message to destination, defaulting to the current output port. message can contain ~A (was %s) and ~S (was %S) escapes. When printed, the escapes are replaced with corresponding members of ARGS: ~A formats using display and ~S formats using write. If destination is #t, then use the current output port, if destination is #f, then return a string containing the formatted text. Does not add a trailing newline.

write-char chr [port] Scheme Procedure
scm_write_char (chr, port) C Function
Send character chr to port.

force-output [port] Scheme Procedure
scm_force_output (port) C Function
Flush the specified output port, or the current output port if port is omitted. The current output buffer contents are passed to the underlying port implementation (e.g., in the case of fports, the data will be written to the file and the output buffer will be cleared.) It has no effect on an unbuffered port.

The return value is unspecified.

flush-all-ports Scheme Procedure
scm_flush_all_ports () C Function
Equivalent to calling force-output on all open output ports. The return value is unspecified.