Skip to content

Commit c10a7f3

Browse files
committed
notes
1 parent fa37501 commit c10a7f3

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

notes/guix-guile-nix/guile_scripting.scrbl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,20 @@
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)

0 commit comments

Comments
 (0)