Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/src/typechecker/typechecker.sml
ViewVC logotype

Diff of /trunk/src/typechecker/typechecker.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 74, Mon May 24 16:38:42 2010 UTC revision 75, Mon May 24 20:41:18 2010 UTC
# Line 17  Line 17 
17      fun checkDiff (cxt, k) =      fun checkDiff (cxt, k) =
18            if (k < 0)            if (k < 0)
19              then raise Fail "differentiation must be >= 0"              then raise Fail "differentiation must be >= 0"
20              else Ty.NatConst(IntInf.toInt k)              else Ty.DiffConst(IntInf.toInt k)
21    
22    (* check a dimension, which must be 2 or 3 *)    (* check a dimension, which must be 2 or 3 *)
23      fun checkDim (cxt, d) =      fun checkDim (cxt, d) =
24            if (d < 2) orelse (3 < d)            if (d < 2) orelse (3 < d)
25              then raise Fail "invalid dimension; must be 2 or 3"              then raise Fail "invalid dimension; must be 2 or 3"
26              else Ty.NatConst(IntInf.toInt d)              else Ty.DimConst(IntInf.toInt d)
27    
28    (* check a shape *)    (* check a shape *)
29      fun checkShape (cxt, shape) = let      fun checkShape (cxt, shape) = let
30            fun chkDim d = if (d < 1)            fun chkDim d = if (d < 1)
31                  then raise Fail "invalid shape dimension; must be >= 1"                  then raise Fail "invalid shape dimension; must be >= 1"
32                  else Ty.NatConst(IntInf.toInt d)                  else Ty.DimConst(IntInf.toInt d)
33            in            in
34              Ty.Shape(List.map chkDim shape)              Ty.Shape(List.map chkDim shape)
35            end            end

Legend:
Removed from v.74  
changed lines
  Added in v.75

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