Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/Doc/manual.tex
ViewVC logotype

Diff of /sml/trunk/src/cm/Doc/manual.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 433, Mon Sep 13 06:57:29 1999 UTC revision 434, Mon Sep 13 08:40:49 1999 UTC
# Line 276  Line 276 
276  stripped away during the resolution process; different anchors that  stripped away during the resolution process; different anchors that
277  map to the same directory still remain different.  map to the same directory still remain different.
278  \item Otherwise, if the relative name appears in some description file  \item Otherwise, if the relative name appears in some description file
279  whose name is {\it path}{\tt /}{it file}{\tt .cm}, then it will be  whose name is {\it path}{\tt /}{\it file}{\tt .cm}, then it will be
280  resolved relative to {\it path}, i.e., relative to the directory that  resolved relative to {\it path}, i.e., relative to the directory that
281  contains the description file.  contains the description file.
282  \item If a non-anchored relative path is entered interactively, for  \item If a non-anchored relative path is entered interactively, for
# Line 420  Line 420 
420  \subsubsection*{Flags}  \subsubsection*{Flags}
421    
422  Several flags control the operation of CM.  Any invocation of the  Several flags control the operation of CM.  Any invocation of the
423  corresponding function reads the current value of the flag.  An  corresponding {\tt get} function reads the current value of the flag.  An
424  invocation with {\tt NONE} just reads it, an invocation with {\tt  invocation of the {\tt set} function replaces the current value with
425  SOME} $v$ reads it and then replaces it with a new value $v$.  It is  the argument given to {\tt set}.
 always the old value that gets returned.  
426    
427  \begin{verbatim}  \begin{verbatim}
428    val verbose : bool option -> bool    val verbose : { get: unit -> bool, set: bool -> unit }
429    val debug : bool option -> bool    val debug : { get: unit -> bool, set: bool -> unit }
430    val keep_going : bool option -> bool    val keep_going : { get: unit -> bool, set: bool -> unit }
431    val parse_caching : int option -> int    val parse_caching : { get: unit -> int, set: int -> unit }
432    val warn_obsolete : bool option -> bool    val warn_obsolete : { get: unit -> bool, set: bool -> unit }
433  \end{verbatim}  \end{verbatim}
434    
435  {\tt CM.verbose} can be used to turn off CM's progress messages.  The  {\tt CM.verbose} can be used to turn off CM's progress messages.  The
# Line 493  Line 492 
492  {\tt CM.resetPathConfig} erases the entire existing path configuration  {\tt CM.resetPathConfig} erases the entire existing path configuration
493  mapping.  mapping.
494    
495    \subsubsection*{Setting CM variables}
496    
497    CM variables are used by the conditional compilation system (see
498    Section~\ref{sec:cmvars}).   Some of these variables are predefined,
499    but the user can add new ones and alter or remove those that already
500    exist.
501    
502    \begin{verbatim}
503      val symval : string ->
504            { get: unit -> int option, set: int option -> unit }
505    \end{verbatim}
506    
507    Function {\tt CM.symval} returns a {\tt get}-{\tt set}-pair for the
508    symbol whose name string was specified as the argument.  Note that the
509    {\tt get}-{\tt set}-pair operates over type {\tt int option}; a value
510    of {\tt NONE} means that the variable is not defined.
511    
512    \noindent Examples:
513    \begin{verbatim}
514    #get (CM.symval "X") ();       (* query value of X *)
515    #set (CM.symval "Y") (SOME 1); (* set Y to 1 *)
516    #set (CM.symval "Z") NONE;     (* remove definition for Z *)
517    \end{verbatim}
518    
519    Some care is necessary as {\tt CM.symval} does not check whether the
520    syntax of the argument string is valid.  (However, the worst thing
521    that could happen is that the name of a variable cannot be written out
522    in CM's description files and that, therefore, the associated value
523    cannot be queried.)
524    
525  \subsubsection*{Status inspection}  \subsubsection*{Status inspection}
526    
527  CM keeps a lot of internal state.  Some of this state can be inspected.  CM keeps a lot of internal state.  Some of this state can be inspected.
# Line 577  Line 606 
606  has recently been recompiled or depends on another compilation unit  has recently been recompiled or depends on another compilation unit
607  whose code has recently been re-executed.  The programmer can  whose code has recently been re-executed.  The programmer can
608  explicitly mark certain ML files as {\em shared}, in which case CM  explicitly mark certain ML files as {\em shared}, in which case CM
609  will issue a warning whenever the unit's code gets re-executed.  will issue a warning whenever the unit's code has to be re-executed.
610    
611  State created by compilation units marked as {\em private} is never  State created by compilation units marked as {\em private} is never
612  shared across multiple calls to {\tt CM.make} or {\tt CM.autoload}.  shared across multiple calls to {\tt CM.make} or {\tt CM.autoload}.
# Line 633  Line 662 
662  \label{sec:classes}  \label{sec:classes}
663    
664  In addition to using existing ML source files, CM can also invoke  In addition to using existing ML source files, CM can also invoke
665  tools that generate ML source code.  Examples for this are  tools that generate ML source code.  Examples are
666  program-generating programs such as ML-Yacc~\cite{tarditi90:yacc} or  program-generating programs such as ML-Yacc~\cite{tarditi90:yacc} or
667  ML-Lex~\cite{appel89:lex}, literate programming tools like  ML-Lex~\cite{appel89:lex}, literate programming tools like
668  noweb~\cite{ramsey:simplified}, but also more generic ``generators''  noweb~\cite{ramsey:simplified}, but also more generic ``generators''
# Line 669  Line 698 
698  \section{Conditional compilation}  \section{Conditional compilation}
699  \label{sec:preproc}  \label{sec:preproc}
700    
701  In its description files, CM files offers a simple conditional  In its description files, CM offers a simple conditional
702  compilation facility inspired by the pre-processor for the C  compilation facility inspired by the pre-processor for the C
703  language~\cite{k&r2}.  However, it is not really a pre-processor, and  language~\cite{k&r2}.  However, it is not really a pre-processor, and
704  the syntax of the controlling expressions is borrowed from SML.  the syntax of the controlling expressions is borrowed from SML.
# Line 698  Line 727 
727  parentheses to enforce precedence.  parentheses to enforce precedence.
728    
729  \subsection{CM variables}  \subsection{CM variables}
730    \label{sec:cmvars}
731    
732  CM provides a number of names that stand for certain integers.  The  CM provides a number of names that stand for certain integers.  The
733  exact set of provided variable names depends on SML/NJ version number,  exact set of provided variable names depends on SML/NJ version number,
# Line 731  Line 761 
761  and {\tt SMLNJ\_MINOR\_VERSION} will be bound to the system's minor  and {\tt SMLNJ\_MINOR\_VERSION} will be bound to the system's minor
762  version number (i.e., the number after the first dot).  version number (i.e., the number after the first dot).
763    
764    Using the {\tt CM.symval} interface one can define additional
765    variables or modify existing ones.
766    
767  \subsection{Querying exported definitions}  \subsection{Querying exported definitions}
768    
769  An expression of the form {\tt defined}($n$ $s$) where $s$ is an ML  An expression of the form {\tt defined}($n$ $s$) where $s$ is an ML
# Line 788  Line 821 
821    
822  \begin{tabbing}  \begin{tabbing}
823  \nt{non-terminal}~\= \ar \kill  \nt{non-terminal}~\= \ar \kill
824  \nt{letter} \> \ar \tl{A} \vb $\ldots$ \vb \tl{Z} \vb  \nt{letter} \> \ar \tl{A} \vb $\ldots$ \vb \tl{Z} \vb \tl{a} \vb $\ldots$ \vb \tl{z} \\
                    \tl{a} \vb $\ldots$ \vb \tl{z} \\  
825  \nt{digit}  \> \ar \tl{0} \vb $\ldots$ \vb \tl{9} \\  \nt{digit}  \> \ar \tl{0} \vb $\ldots$ \vb \tl{9} \\
826  \nt{ldau}   \> \ar \nt{letter} \vb \nt{digit} \vb \tl{'} \vb \tl{\_} \\  \nt{ldau}   \> \ar \nt{letter} \vb \nt{digit} \vb \tl{'} \vb \tl{\_} \\
827  \\  \\
828  \nt{number} \> \ar \nt{digit} \{\nt{digit}\} \\  \nt{number} \> \ar \nt{digit} \{\nt{digit}\} \\
829  \nt{sym}    \> \ar \nt{letter} \{\nt{ldau}\} \\  \nt{sym}    \> \ar \nt{letter} \{\nt{ldau}\} \\
830  \\  \\
831  \nt{aatom}  \> \ar \nt{number} \vb \nt{sym} \vb \tl{(} \nt{asum} \tl{)} \vb  \nt{aatom}  \> \ar \nt{number} \vb \nt{sym} \vb \tl{(} \nt{asum} \tl{)} \vb \tl{$\tilde{~}$} \nt{aatom} \\
                    \tl{$\tilde{~}$} \nt{aatom} \\  
832  \nt{aprod}  \> \ar \{\nt{aprod} (\tl{*} \vb \tl{div} \vb \tl{mod})\} \nt{aatom} \\  \nt{aprod}  \> \ar \{\nt{aprod} (\tl{*} \vb \tl{div} \vb \tl{mod})\} \nt{aatom} \\
833  \nt{asum}   \> \ar \{\nt{asum} (\tl{+} \vb \tl{-})\} \nt{aprod} \\  \nt{asum}   \> \ar \{\nt{asum} (\tl{+} \vb \tl{-})\} \nt{aprod} \\
834  \\  \\
835  \nt{ns}     \> \ar \tl{structure} \vb \tl{signature} \vb \tl{functor} \vb  \nt{ns}     \> \ar \tl{structure} \vb \tl{signature} \vb \tl{functor} \vb \tl{funsig} \\
                    \tl{funsig} \\  
836  \nt{mlsym}  \> \ar {\em a Standard ML identifier} \\  \nt{mlsym}  \> \ar {\em a Standard ML identifier} \\
837  \nt{query}  \> \ar \tl{defined} \tl{(} \nt{sym} \tl{)} \vb  \nt{query}  \> \ar \tl{defined} \tl{(} \nt{sym} \tl{)} \vb \tl{defined} \tl{(} \nt{ns} \nt{mlsym} \tl{)} \\
                    \tl{defined} \tl{(} \nt{ns} \nt{mlsym} \tl{)} \vb \\  
838  \\  \\
839  \nt{acmp}   \> \ar \nt{aexp} (\ttl{<} \vb \ttl{<=} \vb \ttl{>} \vb \ttl{>=} \vb  \nt{acmp}   \> \ar \nt{aexp} (\ttl{<} \vb \ttl{<=} \vb \ttl{>} \vb \ttl{>=} \vb \ttl{=} \vb \ttl{<>}) \nt{aexp} \\
                               \ttl{=} \vb \ttl{<>}) \nt{aexp} \\  
840  \\  \\
841  \nt{batom}  \> \ar \nt{query} \vb \nt{acmp} \vb \tl{not} \nt{batom} \vb  \nt{batom}  \> \ar \nt{query} \vb \nt{acmp} \vb \tl{not} \nt{batom} \vb \tl{(} \nt{bdisj} \tl{)} \\
                    \tl{(} \nt{bdisj} \tl{)} \\  
842  \nt{bcmp}   \> \ar \nt{batom} [(\ttl{=} \vb \ttl{<>}) \nt{batom}] \\  \nt{bcmp}   \> \ar \nt{batom} [(\ttl{=} \vb \ttl{<>}) \nt{batom}] \\
843  \nt{bconj}  \> \ar \{\nt{bcmp} \tl{andalso}\} \nt{bcmp} \\  \nt{bconj}  \> \ar \{\nt{bcmp} \tl{andalso}\} \nt{bcmp} \\
844  \nt{bdisj}  \> \ar \{\nt{bconj} \tl{orelse}\} \nt{bdisj} \\  \nt{bdisj}  \> \ar \{\nt{bconj} \tl{orelse}\} \nt{bdisj} \\
# Line 822  Line 849 
849  \section{Access control}  \section{Access control}
850  \label{sec:access}  \label{sec:access}
851    
 Access control is a new feature. At the moment, only the basic  
 mechanisms are implemented, but there is no enforcement.  In other  
 words, everybody is assumed to have every possible privilege.  CM  
 merely reports which privileges "would have been required".  
   
852  The basic idea behind CM's access control is the following: In their  The basic idea behind CM's access control is the following: In their
853  description files groups and libraries can specify a list of  description files groups and libraries can specify a list of
854  privileges that the client must have in order to be able to use it.  {\em privileges} that the client must have in order to be able to use it.
855  Privileges at this level are just names (strings) and must be written  Privileges at this level are just names (strings) and must be written
856  in front of the initial keyword {\tt Library} or {\tt Group}.  If one  in front of the initial keyword {\tt Library} or {\tt Group}.  If one
857  group or library imports from another group or library, then  group or library imports from another group or library, then
# Line 866  Line 888 
888    
889  Note that privileges cannot be wrapped at the level of CM groups.  Note that privileges cannot be wrapped at the level of CM groups.
890    
891    Access control is a new feature. At the moment, only the basic
892    mechanisms are implemented, but there is no enforcement.  In other
893    words, everybody is assumed to have every possible privilege.  CM
894    merely reports which privileges "would have been required".
895    
896  \section{The pervasive environment and primitive modules}  \section{The pervasive environment and primitive modules}
897    
898  \subsection{The pervasive environment}  \subsection{The pervasive environment}
# Line 996  Line 1023 
1023  (e.g., via {\tt CM.autoload}).  (e.g., via {\tt CM.autoload}).
1024    
1025  The call to {\tt Tools.newCmdGetterSetter} makes a `command  The call to {\tt Tools.newCmdGetterSetter} makes a `command
1026  getter-setter'' which is a value of type {\tt string option ->  getter-setter'' which is a value of type {\tt \{ get: unit -> string,
1027  string}. It can be invoked to query or set the command string for the  set: string -> unit \} }. It can be invoked to query or set the
1028  tool.  Here, the default string is {\tt new-ml-yacc} and can be  command string for the tool.  Here, the default string is {\tt
1029  customized at startup time using the environment variable {\tt  new-ml-yacc} and can be customized at startup time using the
1030  CM\_NYACC}.  environment variable {\tt CM\_NYACC}.
1031    
1032  {\tt Tools.registerStdShellCmdTool} creates the class and installs the  {\tt Tools.registerStdShellCmdTool} creates the class and installs the
1033  tool for it.  The arguments must be specified as follows:  tool for it.  The arguments must be specified as follows:

Legend:
Removed from v.433  
changed lines
  Added in v.434

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0