Added warning about opening scsh structure before scheme structure

in modules.
This commit is contained in:
shivers 1997-04-08 21:42:23 +00:00
parent 33e3bc8c62
commit 0b90a5a030
1 changed files with 36 additions and 0 deletions

View File

@ -145,6 +145,42 @@ Although scsh can be used without referring to the module system at
all, we recommend taking the time to learn and use it. all, we recommend taking the time to learn and use it.
The effort will pay off in the construction of modular, factorable programs. The effort will pay off in the construction of modular, factorable programs.
\subsubsection{Module warning}
Programmers who open both the \ex{scheme} and \ex{scsh} structures in their
own packages should make sure to always put the \ex{scsh} reference first.
\begin{center}
\begin{tabular}{l@{\qquad}l}
Do this: & Not this: \strut \\
\quad{\begin{codebox}[b]
(define-structure web-server
(open scsh
scheme
net-hax
\vdots)
(file web))\end{codebox}}
&
\quad{\begin{codebox}[b]
(define-structure web-server
(open scheme
scsh
net-hax
\vdots)
(file web))\end{codebox}}\\
%
Open \ex{scsh} before \ex{scheme}. &
Not \ex{scsh} after \ex{scheme}.
\end{tabular}
\end{center}
Ordering the two packages like this is necessary because scsh overrides
some of the standard R4RS Scheme definitions exported by the \ex{scheme}
package with its own definitions.
For example, scsh's versions of the R4RS I/O functions such as \ex{display}
and \ex{write} take integer file descriptors as arguments, as well as Scheme
ports.
If you open the \ex{scheme} structure before the \ex{scsh} structure,
you'll get the standard {\scm} definitions, which is not what you want.
\subsection{Switches} \subsection{Switches}
\label{sec:scsh-switches} \label{sec:scsh-switches}
The scsh top-level takes command-line switches in the following format: The scsh top-level takes command-line switches in the following format: