Changeset 10113 for src/Pugs/Prim/Match.hs
- Timestamp:
- 04/28/06 17:47:48 (3 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Prim/Match.hs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/Match.hs
r10059 r10113 79 79 not_VRule _ = True 80 80 81 classType :: Type 82 classType = mkType "Class" 83 81 84 -- XXX - need to generalise this 82 85 op2Match :: Val -> Val -> Eval Val … … 100 103 op2Match x y' 101 104 102 op2Match x@(VObject MkObject{ objType = MkType "Class" } ) y= do105 op2Match x@(VObject MkObject{ objType = cls }) y | cls == classType = do 103 106 fetch <- doHash x hash_fetchVal 104 107 name <- fromVal =<< fetch "name" 105 op2Match (VType ( MkType name)) y106 107 op2Match x y@(VObject MkObject{ objType = MkType "Class" } )= do108 op2Match (VType (mkType name)) y 109 110 op2Match x y@(VObject MkObject{ objType = cls }) | cls == classType = do 108 111 fetch <- doHash y hash_fetchVal 109 112 name <- fromVal =<< fetch "name" 110 op2Match x (VType ( MkType name))113 op2Match x (VType (mkType name)) 111 114 112 115 op2Match x (VSubst (rx, subst)) | rxGlobal rx = do … … 202 205 typ <- fromVal x 203 206 case x of 204 VRef x | typ == MkType "Class" -> do207 VRef x | typ == mkType "Class" -> do 205 208 x' <- readRef x 206 209 op2Match x' y
