#
# KEHOME/kb/method.def
# Aug/27/2005 Dec/31/2006
# MKR methods
# meth is method with purpose,format,label;
# NOTE:
# method is argument $0
# canonical order of prepositional phrases is
# at, out, of, with, od, from, to
# $1 $2 $3 $4 $5 $6 $7
array,list,Set iss ingroup;
enumeration iss exgroup;
ingroup,exgroup iss group;
#===========================#
# associative array methods #
#===========================#
size/gdbm is method of GDBM table with
purpose="count members of GDBM table",
format={
do size/infon od table:5 done;
},
label=[GDBM table];
list tables is method of GDBM database with
purpose="list all tables of GDBM database",
format={
do list tables od view:5 done;
},
label=[view];
delete/infon is method of relation with
purpose="delete member of relation",
format={
do delete/infon od member:5 from relation:6 done;
},
label=[tuple,relation];
delete/gdbm is method of GDBM table with
purpose="delete member of GDBM table",
format={
do delete/gdbm od member:5 from gdbmtable:6 done;
},
label=[member,GDBM table];
dump/relation is method of relation with
purpose="print contents of relation table",
format={
do dump/relation od relation:5 to file:7 done;
},
label=[relation,output file];
dump/gdbm is method of GDBM table with
purpose="print contents of GDBM table",
note="unparse is default translation",
format={
do dump/gdbm od gdbmtable:5
with translation:4
to file:7
done;
},
label=[GDBM table,output file];
#==============#
# list methods #
#==============#
empty is method of group with
purpose="remove all members and all alternatives",
format=[group:*],
label=[list of groups];
list member is method of list with
purpose="get and set list members",
format= {
member:2 :=
do list member od member:5
from list:61,index:62
to list:71,index:72
done;
},
label=[member,input list,input index,output list,output index];
parse list is method of list with
purpose="parse input string and return list",
note="comma is default separator",
format={
list:2 := do parse list with separator:4
od string:5 done;
},
label=[input string,list separator];
reverse list is method of list with
purpose="reverse order of list members",
format=[list:1],
label=[list];
#===============#
# group methods # applicable to list,set,table,...
#===============#
size is method of group with
purpose="count members of group",
format={
do size od group:* done;
},
label=[list of groups];
#