This package contains functions that rely on dynamic checks to perform casting. These functions are introduced solely for bringing some convenience into programming.
fun{tk:tk}
checkast_gintLt{i:int}
(x: g0int(tk), i: int i, msg: RD(string)): g1intLt(tk, i)
fun{tk:tk}
checkast_gintLte{i:int}
(x: g0int(tk), i: int i, msg: RD(string)): g1intLte(tk, i)
fun{tk:tk}
checkast_gintGt{i:int}
(x: g0int(tk), i: int i, msg: RD(string)): g1intGt(tk, i)
fun{tk:tk}
checkast_gintGte{i:int}
(x: g0int(tk), i: int i, msg: RD(string)): g1intGte(tk, i)
fun{tk:tk}
checkast_gintBtw{i,j:int}
(x: g0int(tk), i: int i, j: int j, msg: RD(string)): g1intBtw(tk, i, j)
fun{tk:tk}
checkast_gintBtwe{i,j:int}
(x: g0int(tk), i: int i, j: int j, msg: RD(string)): g1intBtwe(tk, i, j)
macdef
ckastloc_gintLt(x, i) = checkast_gintLt(,(x), ,(i), $mylocation)
macdef
ckastloc_gintLte(x, i) = checkast_gintLte(,(x), ,(i), $mylocation)
macdef
ckastloc_gintGt(x, i) = checkast_gintGt(,(x), ,(i), $mylocation)
macdef
ckastloc_gintGte(x, i) = checkast_gintGte(,(x), ,(i), $mylocation)
implement main0 (argc, argv) = { // fun fact{n:nat} (n: int n): int = if n > 0 then n * fact(n-1) else 1 // val n = ( if argc >= 2 then g0string2int(argv[1]) else 10 ) : int // val n = ckastloc_gintGte (n, 0) // assert: n >= 0 // val () = println! ("fact(", n, ") = ", fact(n)) // } (* end pf [main0] *)
macdef
ckastloc_gintBtw(x, i, j) = checkast_gintBtw(,(x), ,(i), ,(j), $mylocation)
macdef
ckastloc_gintBtwe(x, i, j) = checkast_gintBtwe(,(x), ,(i), ,(j), $mylocation)
fun{}
checkast_Ptr1(x: ptr, msg: RD(string)): Ptr1
macdef
ckastloc_Ptr1(x) = checkast_Ptr1(,(x), $mylocation)
fun{}
checkast_Strptr1(x: Strptr0, msg: RD(string)): Strptr1
macdef
ckastloc_Strptr1(x) = checkast_Strptr1(,(x), $mylocation)
This page is created with ATS by Hongwei Xi and also maintained by Hongwei Xi. |