86 lines
6.9 KiB
HTML
86 lines
6.9 KiB
HTML
<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>CLHS: Macro WITH-STANDARD-IO-SYNTAX</TITLE>
|
|
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
|
|
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
|
|
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
|
|
<LINK REL=TOP HREF="../Front/index.htm">
|
|
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
|
|
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
|
|
<LINK REL=PREV HREF="f_set_sy.htm">
|
|
<LINK REL=UP HREF="c_reader.htm">
|
|
<LINK REL=NEXT HREF="v_rd_bas.htm">
|
|
</HEAD>
|
|
<BODY>
|
|
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="f_set_sy.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="c_reader.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="v_rd_bas.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
<A NAME="with-standard-io-syntax"><I>Macro</I> <B>WITH-STANDARD-IO-SYNTAX</B></A> <P>
|
|
<P><B>Syntax:</B><P>
|
|
<P>
|
|
|
|
<B>with-standard-io-syntax</B> <I><I>form</I><B>*</B></I> => <I><I>result</I><B>*</B></I><P>
|
|
<P>
|
|
<P><B>Arguments and Values:</B><P>
|
|
<P>
|
|
<I>forms</I>---an <A REL=DEFINITION HREF="26_glo_i.htm#implicit_progn"><I>implicit progn</I></A>. <P>
|
|
<I>results</I>---the <A REL=DEFINITION HREF="26_glo_v.htm#value"><I>values</I></A> returned by the <A REL=DEFINITION HREF="26_glo_f.htm#form"><I>forms</I></A>. <P>
|
|
<P><B>Description:</B><P>
|
|
<P>
|
|
Within the dynamic extent of the body of <I>forms</I>, all reader/printer control variables, including any <A REL=DEFINITION HREF="26_glo_i.htm#implementation-defined"><I>implementation-defined</I></A> 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 next figure. <P>
|
|
<PRE>
|
|
Variable Value
|
|
<A REL=DEFINITION HREF="v_pkg.htm#STpackageST">*package*</A> The CL-USER package
|
|
<A REL=DEFINITION HREF="v_pr_ar.htm#STprint-arrayST">*print-array*</A> <A REL=DEFINITION HREF="a_t.htm#t">t</A>
|
|
<A REL=DEFINITION HREF="v_pr_bas.htm#STprint-baseST">*print-base*</A> 10
|
|
<A REL=DEFINITION HREF="v_pr_cas.htm#STprint-caseST">*print-case*</A> :upcase
|
|
<A REL=DEFINITION HREF="v_pr_cir.htm#STprint-circleST">*print-circle*</A> <A REL=DEFINITION HREF="a_nil.htm#nil">nil</A>
|
|
<A REL=DEFINITION HREF="v_pr_esc.htm#STprint-escapeST">*print-escape*</A> <A REL=DEFINITION HREF="a_t.htm#t">t</A>
|
|
<A REL=DEFINITION HREF="v_pr_gen.htm#STprint-gensymST">*print-gensym*</A> <A REL=DEFINITION HREF="a_t.htm#t">t</A>
|
|
<A REL=DEFINITION HREF="v_pr_lev.htm#STprint-lengthST">*print-length*</A> <A REL=DEFINITION HREF="a_nil.htm#nil">nil</A>
|
|
<A REL=DEFINITION HREF="v_pr_lev.htm#STprint-levelST">*print-level*</A> <A REL=DEFINITION HREF="a_nil.htm#nil">nil</A>
|
|
<A REL=DEFINITION HREF="v_pr_lin.htm#STprint-linesST">*print-lines*</A> <A REL=DEFINITION HREF="a_nil.htm#nil">nil</A>
|
|
<A REL=DEFINITION HREF="v_pr_mis.htm#STprint-miser-widthST">*print-miser-width*</A> <A REL=DEFINITION HREF="a_nil.htm#nil">nil</A>
|
|
<A REL=DEFINITION HREF="v_pr_ppr.htm#STprint-pprint-dispatchST">*print-pprint-dispatch*</A> The <A REL=DEFINITION HREF="26_glo_s.htm#standard_pprint_dispatch_table">standard pprint dispatch table</A>
|
|
<A REL=DEFINITION HREF="v_pr_pre.htm#STprint-prettyST">*print-pretty*</A> <A REL=DEFINITION HREF="a_nil.htm#nil">nil</A>
|
|
<A REL=DEFINITION HREF="v_pr_bas.htm#STprint-radixST">*print-radix*</A> <A REL=DEFINITION HREF="a_nil.htm#nil">nil</A>
|
|
<A REL=DEFINITION HREF="v_pr_rda.htm#STprint-readablyST">*print-readably*</A> <A REL=DEFINITION HREF="a_t.htm#t">t</A>
|
|
<A REL=DEFINITION HREF="v_pr_rig.htm#STprint-right-marginST">*print-right-margin*</A> <A REL=DEFINITION HREF="a_nil.htm#nil">nil</A>
|
|
<A REL=DEFINITION HREF="v_rd_bas.htm#STread-baseST">*read-base*</A> 10
|
|
<A REL=DEFINITION HREF="v_rd_def.htm#STread-default-float-formatST">*read-default-float-format*</A> <A REL=DEFINITION HREF="t_short_.htm#single-float">single-float</A>
|
|
<A REL=DEFINITION HREF="v_rd_eva.htm#STread-evalST">*read-eval*</A> <A REL=DEFINITION HREF="a_t.htm#t">t</A>
|
|
<A REL=DEFINITION HREF="v_rd_sup.htm#STread-suppressST">*read-suppress*</A> <A REL=DEFINITION HREF="a_nil.htm#nil">nil</A>
|
|
<A REL=DEFINITION HREF="v_rdtabl.htm#STreadtableST">*readtable*</A> The <A REL=DEFINITION HREF="26_glo_s.htm#standard_readtable">standard readtable</A>
|
|
</PRE>
|
|
<P><B>Figure 23-1. Values of standard control variables</B> <P>
|
|
<P><B>Examples:</B><P>
|
|
<P>
|
|
<PRE>
|
|
(with-open-file (file pathname :direction :output)
|
|
(with-standard-io-syntax
|
|
(print data file)))
|
|
|
|
;;; ... Later, in another Lisp:
|
|
|
|
(with-open-file (file pathname :direction :input)
|
|
(with-standard-io-syntax
|
|
(setq data (read file))))
|
|
</PRE>
|
|
</TT> <P>
|
|
<P><B>Affected By:</B> None.
|
|
<P>
|
|
<P><B>Exceptional Situations:</B> None.
|
|
<P>
|
|
<P><B>See Also:</B> None.
|
|
<P>
|
|
<P><B>Notes:</B> None.
|
|
<P>
|
|
<HR>
|
|
|
|
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
|
|
|
|
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
|
|
</BODY>
|
|
</HTML>
|