Changeset 14534 for src/Pugs/Prim.hs
- Timestamp:
- 10/27/06 02:36:49 (2 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Prim.hs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim.hs
r14492 r14534 1258 1258 fetch <- doHash meta hash_fetchVal 1259 1259 1260 attrs <- fetch "attrs" 1261 1260 1262 name <- fromVal =<< fetch "name" :: Eval String 1261 1263 roles <- fromVals =<< fetch "does" :: Eval [String] 1264 supers <- fromVals =<< fetch "is" :: Eval [String] 1262 1265 1263 1266 -- Role flattening -- copy over things there and put it to symbol table … … 1266 1269 -- XXX - also, copy over the inheritance chain from role's metaobject 1267 1270 mixinRoles name roles 1271 1272 -- Merge in slot definitions in "attrs" 1273 defs <- join $ doHash attrs hash_fetch 1274 parentAttrs <- forM (roles ++ supers) $ fetchMetaInfo "attrs" 1275 store <- doHash attrs hash_store 1276 store $ Map.unions (defs:parentAttrs) 1277 1268 1278 return cls 1269 1279 … … 1273 1283 named <- fromVal n 1274 1284 1275 meta <- readRef =<< fromVal =<< evalExp (_Var (':':'*':showType typ)) 1276 fetch <- doHash meta hash_fetchVal 1277 defs <- fromVal =<< fetch "attrs" 1278 1285 defs <- fetchMetaInfo "attrs" (showType typ) 1279 1286 attrs <- liftIO $ H.new (==) H.hashString 1280 1287 writeIVar (IHash attrs) (named `Map.union` defs) … … 1369 1376 split' [] xs n = VList $ (map (VStr . (:[])) (take (n-1) xs)) ++ [ VStr $ drop (n-1) xs ] 1370 1377 split' glue xs n = VList $ map VStr $ split_n glue xs n 1378 1379 -- XXX - The "String" below wants to be Type. 1380 fetchMetaInfo :: Value a => String -> [Char] -> Eval a 1381 fetchMetaInfo key typ = do 1382 meta <- readRef =<< fromVal =<< evalExp (_Var (':':'*':typ)) 1383 fetch <- doHash meta hash_fetchVal 1384 fromVal =<< fetch key 1371 1385 1372 1386 -- |Implementation of 4-arity primitive operators and functions.
