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/system/smlnj/init/init.cmi
ViewVC logotype

Diff of /sml/trunk/src/system/smlnj/init/init.cmi

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

revision 714, Mon Oct 23 23:39:43 2000 UTC revision 715, Thu Nov 2 07:51:04 2000 UTC
# Line 60  Line 60 
60  #    from SML source code.)  #    from SML source code.)
61  #  - There is one pre-defined name ("primitive") that refers to the  #  - There is one pre-defined name ("primitive") that refers to the
62  #    Environment.primEnv.  It must not be "exported" by the "return" line.  #    Environment.primEnv.  It must not be "exported" by the "return" line.
63    #  - A line of the form "ifdef SYMBOL rest ..." is equivalent to "rest ..."
64    #    if the CM symbol "SYMBOL" is defined (i.e., if "#if defined(SYMBOL)"
65    #    would be true in ordinary description files).  If SYMBOL is not
66    #    defined, then the "ifdef" line will be ignored.
67    #  - Similarly, a line of the form "ifndef SYMBOL rest ..." is equivalent
68    #    to "rest ..." if SYMBOL is not defined; otherwise the line will
69    #    be ignored.
70  #  #
71  # Note that a binding for structure _Core is necessary ALMOST EVERYWHERE.  # Note that a binding for structure _Core is necessary ALMOST EVERYWHERE.
72  # Therefore, it is necessary that the pervasive environment has such a  # Therefore, it is necessary that the pervasive environment has such a
73  # binding.  For files of this initial library (which do not yet have the  # binding.  For files of this initial library (which do not yet have the
74  # benefit of being able to access the pervasive environment), a trivial  # benefit of being able to access the pervasive environment), a trivial
75  # member "xcore" is used to supply _Core.  # member "xcore" is used to supply _Core.
76    #
77    # Conditional compilation:
78    #
79    #  Guarded lines of the "ifdef" and "ifndef" variety (see above) are used to
80    #  achive a limited form of conditional compilation within the init library.
81    #  Since "ifdef" and "ifndef" guards can be applied even to lines that
82    #  are already guarded, one can easily get the effect of a logical "and".
83    #  A logical "or" can be obtained by duplicating lines that have different
84    #  guards. (Be careful with this, though.  The guards of such duplicated
85    #  lines must be mutually exclusive! Otherwise the same ML source might get
86    #  included more than once.)
87    #  Thus, any logical combinaton of conditions can be expressed (albeit perhaps
88    #  clumsily).  For simple case (such as, for example, having different source
89    #  files for different architectures), this facility should be easy to use.
90    #
91    #  Example:
92    #   ...
93    #   ifdef  ARCH_ALPHA32                  bind foo = foo-alpha32.sml (bar, baz)
94    #   ifdef  ARCH_X86                      bind foo = foo-x86.sml (bar, baz)
95    #   ifndef ARCH_ALPHA32 ifndef ARCH_X86  bind foo = foo-default.sml (bar, baz)
96    #   ...
97    #
98    
99  #### END OF EXPLANATION, SPEC STARTS HERE...  #### END OF EXPLANATION, SPEC STARTS HERE...
100    

Legend:
Removed from v.714  
changed lines
  Added in v.715

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