Changeset 2541 for src/Pugs/Types

Show
Ignore:
Timestamp:
05/01/05 06:40:46 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
4052
Message:

* %hash.pairs now returns a list of lvaluable pairs.
* beginning of moving all castfails into Eval monad.

Location:
src/Pugs/Types
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Types/Array.hs

    r2528 r2541  
    201201    array_fetchSize = return . length 
    202202    array_fetchVal av idx = getIndex idx (Just undef) (return av) Nothing 
     203    array_fetchElem av idx = do 
     204        val <- array_fetchVal av idx 
     205        return $ constScalar val 
    203206    array_storeVal _ _ _ = retConstError undef 
    204207    array_storeElem _ _ _ = retConstError undef 
  • src/Pugs/Types/Pair.hs

    r2441 r2541  
    3232    pair_fetchElem pv = do 
    3333        return $ proxyScalar (pair_fetchVal pv) (pair_storeVal pv) 
     34 
     35instance PairClass IPairHashSlice where 
     36    pair_iType = const $ mkType "Pair::HashSlice" 
     37    pair_fetchKey  = return . VStr . fst 
     38    pair_fetchElem = return . snd