Show
Ignore:
Timestamp:
07/09/05 12:10:01 (3 years ago)
Author:
autrijus
svk:copy_cache_prev:
7349
Message:

* handle class literals as the invocant to .isa().

Files:
1 modified

Legend:

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

    r5027 r5335  
    8282    op2Match x y' 
    8383 
     84op2Match x@(VObject MkObject{ objType = MkType "Class" } ) y = do 
     85    fetch   <- doHash x hash_fetchVal 
     86    name    <- fromVal =<< fetch "name" 
     87    op2Match (VType (MkType name)) y 
     88 
    8489op2Match x y@(VObject MkObject{ objType = MkType "Class" } ) = do 
    8590    fetch   <- doHash y hash_fetchVal 
     
    157162op2Match x y@(VType _) = do 
    158163    typ <- fromVal x 
    159     op2Match (VType typ) y 
     164    case x of 
     165        VRef x | typ == MkType "Class" -> do 
     166            x' <- readRef x 
     167            op2Match x' y 
     168        _ -> op2Match (VType typ) y 
    160169 
    161170op2Match (VRef x) y = do