Changeset 4102 for src/Pugs/Types
- Timestamp:
- 05/29/05 18:05:01 (4 years ago)
- svk:copy_cache_prev:
- 5515
- Location:
- src/Pugs/Types
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Types/Array.hs
r3961 r4102 264 264 idxSV <- fromVal $ castV idx 265 265 evalPerl5Sub "sub { $_[0]->[$_[1]] }" [sv, idxSV] 266 array_clear sv = do 267 evalPerl5Sub "sub { undef @{$_[0]} }" [sv] 268 return () 266 269 array_storeVal sv idx val = do 267 270 idxSV <- fromVal $ castV idx … … 269 272 evalPerl5Sub "sub { $_[0]->[$_[1]] = $_[2] }" [sv, idxSV, valSV] 270 273 return () 271 array_storeElem _ _ _ = retConstError undef 272 array_deleteElem _ _ = retConstError undef 274 array_deleteElem sv idx = do 275 idxSV <- fromVal $ castV idx 276 evalPerl5Sub "sub { delete $_[0]->[$_[1]] }" [sv, idxSV] 277 return () -
src/Pugs/Types/Hash.hs
r4084 r4102 123 123 keySV <- fromVal $ castV key 124 124 evalPerl5Sub "sub { $_[0]->{$_[1]} }" [sv, keySV] 125 hash_clear _ = retConstError undef 126 hash_store _ _ = retConstError undef 125 hash_clear sv = do 126 evalPerl5Sub "sub { undef %{$_[0]} }" [sv] 127 return () 127 128 hash_storeVal sv key val = do 128 129 keySV <- fromVal $ castV key … … 134 135 keysStr <- fromVal keysSV 135 136 return $ lines keysStr 136 hash_storeElem _ _ _ = retConstError undef 137 hash_deleteElem _ _ = retConstError undef 137 hash_deleteElem sv key = do 138 keySV <- fromVal $ castV key 139 evalPerl5Sub "sub { delete $_[0]->{$_[1]} }" [sv, keySV] 140 return () 141 hash_isEmpty sv = do 142 fromVal =<< evalPerl5Sub "sub { !!%{$_[0]} }" [sv]
