root/trunk/ProjectFortress/LibraryBuiltin/CompilerBuiltin.fsi

Revision 4341, 2.9 KB (checked in by jmaessen, 7 days ago)

[libraries, codegen] ZZ32 now coerces IntLiteral? as described in the
spec. Over the next few weeks expect more coercions to come on line
as we gradually migrate to a flat numeric hierarchy.

This checkin in particular was a massive joint effort between myself
and the Austin folks (Eric, Justin, and Scott); everyone had their
fingers on most of the bits of code at some point in the past few
days. And now it actually works!

Line 
1(*******************************************************************************
2    Copyright 2009 Sun Microsystems, Inc.,
3    4150 Network Circle, Santa Clara, California 95054, U.S.A.
4    All rights reserved.
5
6    U.S. Government Rights - Commercial software.
7    Government users are subject to the Sun Microsystems, Inc. standard
8    license agreement and applicable provisions of the FAR and its supplements.
9
10    Use is subject to license terms.
11
12    This distribution may include materials developed by third parties.
13
14    Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered
15    trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
16 ******************************************************************************)
17
18api CompilerBuiltin
19import AnyType.{Any}
20
21trait Object extends Any
22end Object
23
24nanoTime(): RR64
25
26trait String
27    getter isEmpty(): Boolean
28    getter asString(): String
29    opr |self| : ZZ32
30    opr || (self, b:String):String
31    opr juxtaposition(self, b:String): String
32end
33
34object FlatString extends String
35end FlatString
36
37println(s:String):()
38println(x:ZZ32):()
39println(x:ZZ64):()
40(* println(x:RR32):() *)
41println(x:RR64):()
42
43strToInt(s:String):ZZ32
44
45trait Number excludes { String }
46    abstract getter asString(): String
47end
48
49trait ZZ64 extends Number excludes RR64
50    getter asZZ32(): ZZ32
51end
52
53trait ZZ32 extends Number excludes { ZZ64, RR64 }
54    coerce(x: IntLiteral)
55    getter asZZ32(): ZZ32
56    getter asString(): String
57    opr |self| : ZZ32
58    opr -(self): ZZ32
59    opr +(self, other:ZZ32): ZZ32
60    opr -(self, other:ZZ32): ZZ32
61    opr <(self, other:ZZ32) : Boolean
62    opr <=(self, other:ZZ32): Boolean
63    opr >(self, other:ZZ32): Boolean
64    opr >=(self, other:ZZ32): Boolean
65    opr =(self, other:ZZ32): Boolean
66    opr juxtaposition(self, other:ZZ32): ZZ32
67    opr DOT(self, other:ZZ32): ZZ32
68    opr DIV(self, other:ZZ32): ZZ32
69end
70
71trait IntLiteral
72    abstract getter asZZ32(): ZZ32
73    abstract getter asZZ64(): ZZ64
74(*
75    abstract getter asNN32(): NN32
76    abstract getter asZZ(): ZZ
77    abstract getter asRR32(): RR32
78*)
79    abstract getter asRR64(): RR64
80end
81
82trait RR64 extends Number
83    getter asString(): String
84    opr |self| : RR64
85    opr -(self): RR64
86    opr +(self, other:RR64): RR64
87    opr -(self, other:RR64): RR64
88    opr <(self, other:RR64): Boolean
89    opr <=(self, other:RR64): Boolean
90    opr >(self, other:RR64): Boolean
91    opr >=(self, other:RR64): Boolean
92    opr =(self, other:RR64): Boolean
93    opr juxtaposition(self, other:RR64): RR64
94    opr DOT(self, other:RR64): RR64
95    opr /(self, other:RR64): RR64
96    opr ^(self, other:RR64): RR64
97    opr ^(self, other:ZZ32): RR64
98end
99
100trait RR32 extends Number
101end
102
103object FloatLiteral extends RR64
104end
105
106
107trait Boolean
108end
109
110true : Boolean
111false : Boolean
112
113(************************************************************
114* Random numbers
115************************************************************)
116
117random(i:RR64): RR64
118randomZZ32(x:ZZ32): ZZ32
119
120end
Note: See TracBrowser for help on using the browser.