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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 79 - (view) (download)

1 : league 79 structure Assert : ASSERT =
2 :     struct
3 :     val enable = ref false
4 :     val ignore = ref false
5 :    
6 :     type auxinfo = string
7 :    
8 :     exception Assert of auxinfo
9 :    
10 :     fun defaultHandler location =
11 :     (TextIO.output (TextIO.stdErr,
12 :     location ^ ": Assertion failed!\n");
13 :     (raise (Assert location)) : unit)
14 :    
15 :     val currentHandler = ref defaultHandler
16 :    
17 :     fun handler NONE = !currentHandler
18 :     | handler (SOME h) = !currentHandler before currentHandler := h;
19 :    
20 :     fun fail aux = (!currentHandler) aux
21 :     end

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