Show
Ignore:
Timestamp:
05/23/05 05:19:44 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
5201
Message:

* Implement ($type_ref Type) too.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Prim/Match.hs

    r3708 r3714  
    7878    op2Match x y' 
    7979 
    80 op2Match (VType typ) (VType t) = do 
    81     cls <- asks envClasses 
    82     return $ VBool (isaType cls (showType t) typ) 
    83  
    84 op2Match x y@(VType _) = do 
    85     typ <- evalValType x 
    86     op2Match (VType typ) y 
    87  
    8880op2Match x (VSubst (rx, subst)) | rxGlobal rx = do 
    8981    str         <- fromVal x 
     
    148140        (return $ VMatch match) 
    149141 
     142op2Match (VRef x) y = do 
     143    x' <- readRef x 
     144    op2Match x' y 
     145 
     146op2Match (VType typ) (VType t) = do 
     147    cls <- asks envClasses 
     148    return $ VBool (isaType cls (showType t) typ) 
     149 
     150op2Match x y@(VType _) = do 
     151    typ <- evalValType x 
     152    op2Match (VType typ) y 
     153 
    150154op2Match x y = op2Cmp (fromVal :: Val -> Eval VStr) (==) x y 
    151155