Printing to strings instead of files or standard output
Each of ACL2's formatted printing functions,
General Forms: result (fms-to-string string alist &key ...) ; string (fmt-to-string string alist &key ...) ; (mv col string) (fmt1-to-string string alist column &key ...) ; (mv col string) (fms!-to-string string alist &key ...) ; string (fmt!-to-string string alist &key ...) ; (mv col string) (fmt1!-to-string string alist column &key ...) ; (mv col string)
The legal keyword arguments are as follows. They are all optional with a
default of
:Evisc-tuple is evaluated, and corresponds exactly to theevisc-tuple argument of the correspondingFM* function; see fmt.
:Fmt-control-alist should typically evaluate to an alist that maps print-control variables to values; see print-control. Any alist mapping variables to values is legal, however. By default the print controls are set according to the value of constant*fmt-control-defaults* ;:fmt-control-alist overrides these defaults. For example,*fmt-control-defaults* sets the right margin just as it is set in the initial ACL2 state, by bindingfmt-soft-right-margin andfmt-hard-right-margin to their respective defaults of*fmt-soft-right-margin-default* and*fmt-hard-right-margin-default* . The following example shows how you can override those defaults, in this case arranging to print flat by setting the right margin to a large number.(fmt-to-string "~x0" (list (cons #\0 (make-list 30))) :fmt-control-alist `((fmt-soft-right-margin . 10000) (fmt-hard-right-margin . 10000)))
Also see io for a discussion of the utility
Remarks on deviation from the fmt functions.