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

SCM Repository

[diderot] Annotation of /trunk/src/compiler/ast/var.sml
ViewVC logotype

Annotation of /trunk/src/compiler/ast/var.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 78 - (view) (download)
Original Path: trunk/src/ast/var.sml

1 : jhr 71 (* var.sml
2 :     *
3 :     * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)
4 :     * All rights reserved.
5 :     *)
6 :    
7 :     structure Var =
8 :     struct
9 :    
10 :     datatype var = datatype AST.var
11 :    
12 : jhr 72 datatype var_kind = datatype AST.var_kind
13 :    
14 : jhr 71 fun typeOf (V{ty, ...}) = ty
15 : jhr 72 fun kindOf (V{kind, ...}) = kind
16 : jhr 71
17 :     fun new (name, kind, ty) = let
18 :     val id = Stamp.new()
19 :     in
20 :     V{name=Atom.toString name, id=id, kind=kind, ty=([], ty)}
21 :     end
22 :    
23 : jhr 78 fun newPoly (name, kind, scheme) = let
24 :     val id = Stamp.new()
25 :     in
26 :     V{name=Atom.toString name, id=id, kind=kind, ty=scheme}
27 :     end
28 :    
29 : jhr 71 end

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