105 lines
5.4 KiB
HTML
105 lines
5.4 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: Issue IN-SYNTAX Writeup</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="../Issues/iss195_w.htm">
|
|
<LINK REL=UP HREF="../Issues/iss196.htm">
|
|
<LINK REL=NEXT HREF="../Issues/iss197_w.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="../Issues/iss195_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss196.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss197_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H2>Issue IN-SYNTAX Writeup</H2>
|
|
|
|
<PRE><B>Status:</B> Passed, Mar 89 X3J13<P>
|
|
<B>Issue:</B> <A HREF="iss196.htm">IN-SYNTAX</A><P>
|
|
<B>Edit History:</B> 21-Oct-88, Version 1 by Pitman<P>
|
|
Version 2, KMP 3/30/89<P>
|
|
Version 3, 9-Apr-89, Masinter<P>
|
|
(Include discussion from Version 1)<P>
|
|
<P>
|
|
<B>Problem Description:<P>
|
|
</B><P>
|
|
There is no way to bind read syntax within a file.<P>
|
|
<P>
|
|
As a result, applications which <A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>require</B></A> extended syntax of some sort<P>
|
|
tend to globally modify the lisp <A REL=DEFINITION HREF="../Body/t_rdtabl.htm#readtable"><B>readtable</B></A> at compile and load time,<P>
|
|
sometimes interfering with other modules and/or user interaction.<P>
|
|
<P>
|
|
Conscientious developers often avoid the creation of any stylized<P>
|
|
syntax because of its likely effect on parts of the environment which<P>
|
|
don't really belong to the application developer. This need for<P>
|
|
paranoia is probably contrived and the result of what amounts to<P>
|
|
an oversight in the design of Common Lisp.<P>
|
|
<P>
|
|
<P>
|
|
<B>Proposal (IN-SYNTAX:MINIMAL):<P>
|
|
</B><P>
|
|
Define that <A REL=DEFINITION HREF="../Body/f_cmp_fi.htm#compile-file"><B>COMPILE-FILE</B></A> and <A REL=DEFINITION HREF="../Body/f_load.htm#load"><B>LOAD</B></A> bind <A REL=DEFINITION HREF="../Body/v_rdtabl.htm#STreadtableST"><B>*READTABLE*</B></A> to its current value.<P>
|
|
<P>
|
|
<B>Rationale:<P>
|
|
</B><P>
|
|
This allows portable programs to do<P>
|
|
<P>
|
|
(<A REL=DEFINITION HREF="../Body/m_in_pkg.htm#in-package"><B>IN-PACKAGE</B></A> "FOO")<P>
|
|
(<A REL=DEFINITION HREF="../Body/s_eval_w.htm#eval-when"><B>EVAL-WHEN</B></A> (<A REL=DEFINITION HREF="../Body/f_eval.htm#eval"><B>EVAL</B></A> <A REL=DEFINITION HREF="../Body/f_load.htm#load"><B>LOAD</B></A> <A REL=DEFINITION HREF="../Body/f_cmp.htm#compile"><B>COMPILE</B></A>)<P>
|
|
(<A REL=DEFINITION HREF="../Body/s_setq.htm#setq"><B>SETQ</B></A> <A REL=DEFINITION HREF="../Body/v_rdtabl.htm#STreadtableST"><B>*READTABLE*</B></A> FOO:MY-READTABLE))<P>
|
|
<P>
|
|
at the top of a file without globally side-effecting the<P>
|
|
environment.<P>
|
|
<P>
|
|
Currently, there is no portable way to change the syntax only for<P>
|
|
the duration of a file, which in turn makes customized syntax<P>
|
|
difficult to use safely.<P>
|
|
<P>
|
|
Programs that want to side effect the environment can instead<P>
|
|
continue to modify <A REL=DEFINITION HREF="../Body/v_rdtabl.htm#STreadtableST"><B>*READTABLE*</B></A>.<P>
|
|
<P>
|
|
This is enough of a foothold to implement a more elaborate facility<P>
|
|
for using readtables in a localized way.<P>
|
|
<P>
|
|
<P>
|
|
<B>Current Practice:<P>
|
|
</B><P>
|
|
mixed<P>
|
|
<P>
|
|
<B>Cost to Implementors:<P>
|
|
</B><P>
|
|
Very small.<P>
|
|
<P>
|
|
<B>Cost to Users:<P>
|
|
</B><P>
|
|
small<P>
|
|
<P>
|
|
<B>Cost of Non-Adoption:<P>
|
|
</B><P>
|
|
Readtables would continue to be hard to use in a clean way.<P>
|
|
<P>
|
|
<B>Benefits:<P>
|
|
</B><P>
|
|
If people could use readtables safely, we might see more interesting<P>
|
|
experimentation with read syntax.<P>
|
|
<P>
|
|
<B>Aesthetics:<P>
|
|
</B><P>
|
|
A slight improvement to aesthetics by controlling what was formerly<P>
|
|
an unbounded side-effect (modification to the global <A REL=DEFINITION HREF="../Body/t_rdtabl.htm#readtable"><B>readtable</B></A>).<P>
|
|
<P>
|
|
</PRE>
|
|
<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>
|