The Meta-Environment API
00001 #ifndef __MODULE_UTILS__ 00002 #define __MODULE_UTILS__ 00003 00004 /* This file extends the generic module concept with a path for each module */ 00005 00006 #define EMPTY_PATH "" 00007 00008 process GetModulePath(ModuleId: module-id, Namespace: term, Path: str?) is 00009 let 00010 Term: path, 00011 HasAttribute: bool 00012 in 00013 MM-HasAttribute(ModuleId, Namespace, "path", HasAttribute?) 00014 . 00015 if equal(HasAttribute, true) then 00016 MM-GetAttribute(ModuleId, Namespace, "path", Term?) 00017 . Path := first(args(Term)) 00018 else 00019 Path := EMPTY_PATH 00020 fi 00021 endlet 00022 00023 process SetModulePath(ModuleId: module-id, Namespace: term, Path: str) is 00024 let 00025 Term: path 00026 in 00027 Term := quote(path(Path)) 00028 . MM-SetAttribute(ModuleId, Namespace, "path", Term) 00029 endlet 00030 00031 #endif /* __MODULE_UTILS__ */