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

SCM Repository

[diderot] Diff of /branches/lamont_dev/src/compiler/high-il/high-il-types.sml
ViewVC logotype

Diff of /branches/lamont_dev/src/compiler/high-il/high-il-types.sml

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

revision 2038, Tue Oct 16 11:31:02 2012 UTC revision 2039, Wed Oct 17 16:10:37 2012 UTC
# Line 8  Line 8 
8    struct    struct
9    
10      datatype ty      datatype ty
11        = BoolTy | IntTy | StringTy        = BoolTy | IntTy | StringTy | StrandSeqTy
12        | TensorTy of int list        | TensorTy of int list
       | StrandTy  
13        | TupleTy of ty list              (* tuples; used for multiple return values *)        | TupleTy of ty list              (* tuples; used for multiple return values *)
14        | SeqTy of ty * int        | SeqTy of ty * int
15        | ImageTy of int        | ImageTy of int
# Line 33  Line 32 
32        | same (_, AnyTy) = true        | same (_, AnyTy) = true
33        | same (BoolTy, BoolTy) = true        | same (BoolTy, BoolTy) = true
34        | same (IntTy, IntTy) = true        | same (IntTy, IntTy) = true
35        | same (StringTy, StringTy) = true        | same (StrandSeqTy, StrandSeqTy) = true
36        | same (TensorTy dd1, TensorTy dd2) = (dd1 = dd2)        | same (TensorTy dd1, TensorTy dd2) = (dd1 = dd2)
37        | same (TupleTy tys1, TupleTy tys2) = ListPair.allEq same (tys1, tys2)        | same (TupleTy tys1, TupleTy tys2) = ListPair.allEq same (tys1, tys2)
38        | same (SeqTy(ty1, n1), SeqTy(ty2, n2)) = (n1 = n2) andalso same(ty1, ty2)        | same (SeqTy(ty1, n1), SeqTy(ty2, n2)) = (n1 = n2) andalso same(ty1, ty2)
# Line 45  Line 44 
44      fun hash BoolTy = 0w1      fun hash BoolTy = 0w1
45        | hash StringTy = 0w2        | hash StringTy = 0w2
46        | hash IntTy = 0w3        | hash IntTy = 0w3
47          | hash StrandSeqTy = 0w4
48        | hash (TensorTy dd) = List.foldl (fn (d, s) => Word.fromInt d + s) 0w5 dd        | hash (TensorTy dd) = List.foldl (fn (d, s) => Word.fromInt d + s) 0w5 dd
49        | hash (TupleTy tys) = List.foldl (fn (ty, s) => hash ty + s) 0w7 tys        | hash (TupleTy tys) = List.foldl (fn (ty, s) => hash ty + s) 0w7 tys
50        | hash (SeqTy(ty, n)) = Word.fromInt n * hash ty + 0w11        | hash (SeqTy(ty, n)) = Word.fromInt n * hash ty + 0w11
# Line 55  Line 55 
55    
56      fun toString BoolTy = "bool"      fun toString BoolTy = "bool"
57        | toString StringTy = "string"        | toString StringTy = "string"
58          | toString StrandSeqTy = "@unknown@{}"
59        | toString IntTy = "int"        | toString IntTy = "int"
60        | toString (TensorTy[]) = "real"        | toString (TensorTy[]) = "real"
61        | toString (TensorTy dd) = String.concat[        | toString (TensorTy dd) = String.concat[

Legend:
Removed from v.2038  
changed lines
  Added in v.2039

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