)abbrev package HYPER HyperDoc HyperDoc(): Exports == Implementation where Exports == with getDatabases: () -> Void getDocumentation: String -> String Implementation == add ops: Database IndexCard := getDatabase("o")$OperationsQuery getDatabases == ops := getDatabase("o")$OperationsQuery -- ostretch`2`x`(_$,ACMachineInteger)->_$`dCycleIndexSeries`` filter(dbase: Database IndexCard, leq: List QueryEquation): Database IndexCard == res: Database IndexCard := dbase for eq in leq repeat res := res.eq res getSpecification(op: IndexCard): String == s: String := concat([op.'name, "`", op.'type, "`", op.'origin]) systemCommand("sys rm myspec")$MoreSystemCommands f: TextFile := open("myspec"::FileName, "output") writeLine!(f, s) close! f systemCommand("sys md5sum myspec > md5spec")$MoreSystemCommands f: TextFile := open("md5spec"::FileName, "input") r := readLine! f close! f r.(1..32) -- this function should really be in Database. Well, actually Database should -- export Table or some such coerce(dbase: Database IndexCard): List IndexCard == dbase pretend List IndexCard getDocumentation s == import QueryEquation import Database IndexCard ls := split(s, char "`") output(ls::OutputForm)$OutputPackage leq: List QueryEquation := [] if ls.1 ~= " " then leq := [equation('name, ls.1)] if #ls > 1 and ls.2 ~= " " then leq := cons(equation('type, ls.2), leq) if #ls > 2 and ls.3 ~= " " then leq := cons(equation('origin, ls.3), leq) r: List IndexCard := coerce(filter(ops, leq)) output(r::OutputForm)$OutputPackage if empty? r then "error.html" else res: String n := #r if n > 1 then res := "result.html" output(res::OutputForm)$OutputPackage g: TextFile := open(res::FileName, "output") writeLine!(g, _ " _