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

SCM Repository

[smlnj] View of /sml/trunk/src/compiler/PervEnv/NJ/assert.sml
ViewVC logotype

View of /sml/trunk/src/compiler/PervEnv/NJ/assert.sml

Parent Directory Parent Directory | Revision Log Revision Log

Revision 79 - (download) (annotate)
Sat Apr 18 00:19:45 1998 UTC (23 years ago) by league
File size: 529 byte(s)
assertions and .smlnjrc
structure Assert : ASSERT =
    val enable = ref false
    val ignore = ref false

    type auxinfo = string

    exception Assert of auxinfo

    fun defaultHandler location =
        (TextIO.output (TextIO.stdErr,
                        location ^ ": Assertion failed!\n");
         (raise (Assert location)) : unit)

    val currentHandler = ref defaultHandler

    fun handler NONE = !currentHandler
      | handler (SOME h) = !currentHandler before currentHandler := h;

    fun fail aux = (!currentHandler) aux

ViewVC Help
Powered by ViewVC 1.0.0