This shows you the differences between two versions of the page.
cl:macros:with-standard-io-syntax [2019/12/05 03:00] |
cl:macros:with-standard-io-syntax [2019/12/07 22:00] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Macro WITH-STANDARD-IO-SYNTAX ====== | ||
+ | |||
+ | ====Syntax==== | ||
+ | * **with-standard-io-syntax** //form//''*'' → //result//''*'' | ||
+ | |||
+ | ====Arguments and Values==== | ||
+ | * //forms// - an //[[CL:Glossary:implicit progn]]//. | ||
+ | * //results// - the //[[CL:Glossary:values]]// returned by the //[[CL:Glossary:forms]]//. | ||
+ | |||
+ | ====Description==== | ||
+ | Within the dynamic extent of the body of //forms//, all reader/printer control variables, including any //[[CL:Glossary:implementation-defined]]// ones not specified by this standard, are bound to values that produce standard read/print behavior. The values for the variables specified by this standard are listed in the below table. | ||
+ | |||
+ | ^ Variable ^ Value ^ | ||
+ | | **[[CL:Variables:*package*]]** | The **''cl-user''** //[[CL:Glossary:package]]// | | ||
+ | | **[[CL:Variables:*print-array*]]** | **[[CL:Constant Variables:t]]** | | ||
+ | | **[[CL:Variables:*print-base*]]** | ''10'' | | ||
+ | | **[[CL:Variables:*print-case*]]** | **'':upcase''** | | ||
+ | | **[[CL:Variables:*print-circle*]]** | **[[CL:Constant Variables:nil]]** | | ||
+ | | **[[CL:Variables:*print-escape*]]** | **[[CL:Constant Variables:t]]** | | ||
+ | | **[[CL:Variables:*print-gensym*]]** | **[[CL:Constant Variables:t]]** | | ||
+ | | **[[CL:Variables:*print-length*]]** | **[[CL:Constant Variables:nil]]** | | ||
+ | | **[[CL:Variables:*print-level*]]** | **[[CL:Constant Variables:nil]]** | | ||
+ | | **[[CL:Variables:*print-lines*]]** | **[[CL:Constant Variables:nil]]** | | ||
+ | | **[[CL:Variables:*print-miser-width*]]** | **[[CL:Constant Variables:nil]]** | | ||
+ | | **[[CL:Variables:*print-pprint-dispatch*]]** | The //[[CL:Glossary:standard pprint dispatch table]]// | | ||
+ | | **[[CL:Variables:*print-pretty*]]** | **[[CL:Constant Variables:nil]]** | | ||
+ | | **[[CL:Variables:*print-radix*]]** | **[[CL:Constant Variables:nil]]** | | ||
+ | | **[[CL:Variables:*print-readably*]]** | **[[CL:Constant Variables:t]]** | | ||
+ | | **[[CL:Variables:*print-right-margin*]]** | **[[CL:Constant Variables:nil]]** | | ||
+ | | **[[CL:Variables:*read-base*]]** | ''10'' | | ||
+ | | **[[CL:Variables:*read-default-float-format*]]** | **[[CL:Types:single-float]]** | | ||
+ | | **[[CL:Variables:*read-eval*]]** | **[[CL:Constant Variables:t]]** | | ||
+ | | **[[CL:Variables:*read-suppress*]]** | **[[CL:Constant Variables:nil]]** | | ||
+ | | **[[CL:Variables:*readtable*]]** | The //[[CL:Glossary:standard readtable]]// | | ||
+ | |||
+ | |||
+ | ====Examples==== | ||
+ | <blockquote> | ||
+ | ([[CL:Macros:with-open-file]] (file pathname :direction :output) | ||
+ | (with-standard-io-syntax | ||
+ | ([[CL:Functions:print]] data file)) | ||
+ | nil) <r>NIL</r> | ||
+ | |||
+ | ;;; ... Later, in another Lisp: | ||
+ | |||
+ | ([[CL:Macros:with-open-file]] (file pathname :direction :input) | ||
+ | (with-standard-io-syntax | ||
+ | ([[CL:Macros:defvar]] *data* ([[CL:Functions:read]] file)))) <r>*DATA*</r> | ||
+ | </blockquote> | ||
+ | |||
+ | ====Affected By==== | ||
+ | None. | ||
+ | |||
+ | ====Exceptional Situations==== | ||
+ | None. | ||
+ | |||
+ | ====See Also==== | ||
+ | None. | ||
+ | |||
+ | ====Notes==== | ||
+ | None. | ||