File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646
4747 ;; Formatted output like fprintf from (use-modules (ice-9 format))
4848 ;; https://www.gnu.org/software/guile/manual/html_node/Formatted-Output.html
49+ ;; http://gnu.ist.utl.pt/software/guile/docs/docs-1.6/guile-ref/Formatted-Output.html
4950 | | Destination | Style | Result | |
5051 |------------------------+-------------------+-----------+---------------+---------------------------------|
5152 | (format #t "~a\n " "x " ) | stdout (terminal) | aesthetic | x (newline) | Print readable form to terminal |
5253 | (format #t "~s\n " "x " ) | stdout (terminal) | standard | "x " (newline) | Print with quotes to terminal |
5354 | (format #f "~a\n " "x " ) | return string | aesthetic | "x\n " | Return readable form as string |
5455 | (format #f "~s\n " "x " ) | return string | standard | "\"x\"\n " | Return with quotes as string |
5556 ;;
56- ;; #t outputs to current output port (usually terminal), #f returns a string
57- ;; ~a gives aesthetic/readable format, ~s gives standard/quoted format (like `write` vs `display`)
58- ;; ;; Use ~a for human-readable output, ~s for machine-readable/serializable output
57+ ;; #t outputs to current output port (usually terminal)
58+ ;; #f returns a string
59+ ;; ~a gives aesthetic/readable format, for human-readable output
60+ ;; ~s gives standard/quoted format (like `write` vs `display`),
61+ ;; for machine-readable/serializable output
62+ ;; ~y pretty-print
5963
6064 ;; https://www.draketo.de/software/guile-capture-stdout-stderr.html
6165 (use-modules (ice-9 rdelim)
You can’t perform that action at this time.
0 commit comments