## generic-ops.pkg
## (C) 2001 Lucent Technologies, Bell Labs
## author: Matthias Blume (blume@research.bell-labs.com)
# Compiled by:
#
src/app/makelib/portable-graph/portable-graph-stuff.libapi Pg_Ops {
Context (A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc);
sgn: Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc )
-> String
-> (Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc ),
A_symbol);
str: Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc )
-> String
-> (Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc ),
A_symbol);
fct: Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc )
-> String
-> (Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc ),
A_symbol);
syms: Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc )
-> List( A_symbol )
-> (Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc ),
A_syms);
an_import: Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc )
-> A_lib -> A_syms
-> (Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc ),
A_dictionary);
compile: Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc )
-> String
-> A_dictionary
-> A_syms
-> (Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc ),
A_dictionary);
ncompile: Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc )
-> String
-> A_dictionary
-> A_syms
-> (Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc ),
A_dictionary);
merge: Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc )
-> List( A_dictionary )
-> (Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc ),
A_dictionary);
filter: Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc )
-> A_dictionary
-> A_syms
-> (Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc ),
A_dictionary);
export: Context( A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc )
-> A_dictionary
-> A_export;
};
package pgops: (weak) Pg_Ops { # Pg_Ops is from
src/app/makelib/portable-graph/generic-ops.pkg Context (A_lib, A_dictionary, A_symbol, A_syms, A_export, A_misc)
=
{ ops: { sgn: A_misc -> String -> (A_misc, A_symbol),
packagex: A_misc -> String -> (A_misc, A_symbol),
generic_x: A_misc -> String -> (A_misc, A_symbol),
imp: A_misc -> (A_lib, A_syms) -> (A_misc, A_dictionary),
com: A_misc -> (String, A_dictionary, A_syms, Bool) -> (A_misc, A_dictionary),
mer: A_misc -> List( A_dictionary) -> (A_misc, A_dictionary),
fil: A_misc -> (A_dictionary, A_syms) -> (A_misc, A_dictionary),
syms: A_misc -> List( A_symbol ) -> (A_misc, A_syms),
expression: A_misc -> A_dictionary -> A_export },
misc: A_misc
};
stipulate
fun generic' { ops => ops as { sgn, packagex, generic_x,
imp, com, mer, fil, syms, expression },
misc }
sel args =
{ my (misc', result) = sel ops misc args;
( { ops, misc => misc' }, result);
};
herein
fun sgn c s = generic' c .sgn s;
fun str c s = generic' c .packagex s;
fun fct c s = generic' c .generic_x s;
fun syms c sl = generic' c .syms sl;
fun an_import c l ss = generic' c .imp (l, ss);
fun compile c s e ss = generic' c .com (s, e, ss, FALSE);
fun ncompile c s e ss = generic' c .com (s, e, ss, TRUE);
fun merge c el = generic' c .mer el;
fun filter c e ss = generic' c .fil (e, ss);
fun export { ops => { sgn,
packagex,
generic_x,
imp,
com,
mer,
fil,
syms,
expression
},
misc
}
e
=
expression misc e;
end;
};