Show
Ignore:
Timestamp:
06/11/06 16:21:32 (2 years ago)
Author:
audreyt
Message:

* Prim: VType is considered undef

Files:
1 modified

Legend:

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

    r10531 r10616  
    1616    | VUndef <- x = op2Numeric f (VInt 0) y 
    1717    | VUndef <- y = op2Numeric f x (VInt 0) 
     18    | VType{} <- x = op2Numeric f (VInt 0) y 
     19    | VType{} <- y = op2Numeric f x (VInt 0) 
    1820    | (VInt x', VInt y') <- (x, y)  = return $ VInt $ f x' y' 
    1921    | (VRat x', VInt y') <- (x, y)  = return $ VRat $ f x' (y' % 1) 
     
    4648op1Numeric :: (forall a. (Num a) => a -> a) -> Val -> Eval Val 
    4749op1Numeric f VUndef     = return . VInt $ f 0 
     50op1Numeric f VType{}    = return . VInt $ f 0 
    4851op1Numeric f (VInt x)   = return . VInt $ f x 
    4952op1Numeric f l@(VList _)= fmap (VInt . f) (fromVal l)