root/trunk/ProjectFortress/LibraryBuiltin/NatReflect.fsi

Revision 3056, 1.3 KB (checked in by black, 13 months ago)

converted many toString() methods to asString getters

Line 
1(*******************************************************************************
2    Copyright 2008 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 NatReflect
19
20(** Reflection for run-time integers into compile-time nat parameters.
21 *
22 *  Basically you can call the function reflect(n) and it will return
23 *  an instance of NatParam.  But every instance of NatParam is an
24 *  object N[\n\], so we can write a function which takes N[\n\] and
25 *  pass it a NatParam; within that function n becomes a static nat
26 *  parameter.
27 *)
28trait NatParam
29  (* comprises { N[\n\] } where [\ nat n \] *)
30  abstract getter toZZ() : ZZ32
31end
32
33value object N[\nat n\] extends { NatParam }
34end
35
36(* Actually convert a ZZ32 into a NatParam. *)
37reflect(z:ZZ32):NatParam
38
39end
Note: See TracBrowser for help on using the browser.