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/branches/idlbasis-devel/src/system/Basis/Implementation/bool.sml
ViewVC logotype

Annotation of /sml/branches/idlbasis-devel/src/system/Basis/Implementation/bool.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 863 - (view) (download)

1 : monnier 416 (* bool.sml
2 :     *
3 :     * COPYRIGHT (c) 1995 AT&T Bell Laboratories.
4 :     *)
5 :    
6 :     structure Bool : BOOL =
7 :     struct
8 :    
9 :     datatype bool = datatype PrimTypes.bool
10 :    
11 :     val not = InlineT.inlnot
12 :    
13 : dbm 849 (* DBM: generalized to be case insensitive, as per new Basis spec;
14 :     * note spaces after "|" because of bug 1610.
15 : monnier 416 *)
16 :     fun scan (getc : (char, 'a) StringCvt.reader) cs = (
17 :     case (getc (PreBasis.skipWS getc cs))
18 : dbm 849 of (SOME((#"t"| #"T"), cs')) => (case (PreBasis.getNChars getc (cs', 3))
19 : blume 863 of (SOME([(#"r"| #"R"), (#"u"| #"U"), (#"e"| #"E")], cs'')) =>
20 : dbm 849 SOME(true, cs'')
21 : monnier 416 | _ => NONE
22 :     (* end case *))
23 : dbm 849 | (SOME((#"f"| #"F"), cs')) => (case (PreBasis.getNChars getc (cs', 4))
24 :     of (SOME([(#"a"| #"A"), (#"l"| #"L"), (#"s"| #"S"), (#"e"| #"E")], cs'')) =>
25 :     SOME(false, cs'')
26 : monnier 416 | _ => NONE
27 :     (* end case *))
28 :     | _ => NONE
29 :     (* end case *))
30 :    
31 :     fun toString true = "true"
32 :     | toString false = "false"
33 :     val fromString = PreBasis.scanString scan
34 :    
35 :     end
36 :    
37 :    

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