Added warning about opening scsh structure before scheme structure
in modules.
This commit is contained in:
parent
33e3bc8c62
commit
0b90a5a030
|
@ -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.
|
||||
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}
|
||||
\label{sec:scsh-switches}
|
||||
The scsh top-level takes command-line switches in the following format:
|
||||
|
|
Loading…
Reference in New Issue