Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/compiler/ElabData/basics/primopid.sml
ViewVC logotype

Diff of /sml/trunk/compiler/ElabData/basics/primopid.sml

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

revision 1968, Tue Jul 11 15:10:15 2006 UTC revision 1969, Tue Jul 11 15:35:49 2006 UTC
# Line 30  Line 30 
30    fun isPrimCast (Prim "cast") = true    fun isPrimCast (Prim "cast") = true
31      | isPrimCast _ = false      | isPrimCast _ = false
32    
33    fun selStrPrimId(StrE elems, slot) = List.nth(elems, slot)    (* Select the prim ids for a substructure *)
34      | selStrPrimId(PrimE id, slot) =    fun selStrPrimId(elems, slot) =
35          bug "PrimOpId.selStrPrimId: unexpected PrimE"        (case List.nth(elems, slot)
36            of StrE elems' => elems'
37             | PrimE _ => bug "PrimOpId.selStrPrimId: unexpected PrimE")
38          (* This bug happens if we got a primid for a value          (* This bug happens if we got a primid for a value
39             component when we expected a strPrimElem for a             component when we expected a strPrimElem for a
40             structure *)             structure *)
41    
42    fun selValPrimFromStrPrim(StrE elems, slot) =    (* Select the prim id for a value component *)
43      fun selValPrimFromStrPrim(elems, slot) =
44        (case List.nth(elems, slot)        (case List.nth(elems, slot)
45          of PrimE(id) => id          of PrimE(id) => id
46           | _ =>           | _ =>
47             bug "PrimOpId.selValPrimFromStrPrim: unexpected StrE")             bug "PrimOpId.selValPrimFromStrPrim: unexpected StrE"
48          )
49             (* This bug occurs if we got a substructure's             (* This bug occurs if we got a substructure's
50                strPrimElem instead of an expected value component's                strPrimElem instead of an expected value component's
51                primId *)                primId *)
     | selValPrimFromStrPrim(PrimE _, slot) =  
       bug "PrimOpId.selValPrimFromStrPrim: unexpected PrimE"  
52    
53  (*  (*
54      fun selStrInfo (StrE l, i) =      fun selStrInfo (StrE l, i) =

Legend:
Removed from v.1968  
changed lines
  Added in v.1969

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