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

SCM Repository

[diderot] Diff of /branches/lamont/src/compiler/ast/type-util.sml
ViewVC logotype

Diff of /branches/lamont/src/compiler/ast/type-util.sml

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

revision 2547, Fri Feb 21 16:47:26 2014 UTC revision 2548, Wed Feb 26 14:22:24 2014 UTC
# Line 21  Line 21 
21     *)     *)
22      val slice : Types.ty * bool list -> Types.ty      val slice : Types.ty * bool list -> Types.ty
23    
24       (* returns the dimension of a vector represented as an integer *)
25        val vecDim : Types.ty -> int
26    
27    (* returns true if the type is a has a static size (i.e., not a dynamic sequence) *)    (* returns true if the type is a has a static size (i.e., not a dynamic sequence) *)
28      val isFixedSizeType : Types.ty -> bool      val isFixedSizeType : Types.ty -> bool
29    
# Line 300  Line 303 
303             of Ty.DiffConst k => k             of Ty.DiffConst k => k
304              | diff => raise Fail(concat["diff ", diffToString diff, " is not constant"])              | diff => raise Fail(concat["diff ", diffToString diff, " is not constant"])
305            (* end case *))            (* end case *))
306            fun vecDim ty = (case ty
307               of Ty.T_Tensor(Ty.Shape[Ty.DimConst n]) => n
308                | _ => raise Fail(concat["type: ", toString ty, " is not a vector type"])
309                (* end case *))
310    end    end

Legend:
Removed from v.2547  
changed lines
  Added in v.2548

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