diff options
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/br-con.boot (renamed from src/interp/br-con.boot.pamphlet) | 30 | ||||
-rw-r--r-- | src/interp/br-data.boot (renamed from src/interp/br-data.boot.pamphlet) | 28 | ||||
-rw-r--r-- | src/interp/br-op1.boot (renamed from src/interp/br-op1.boot.pamphlet) | 28 | ||||
-rw-r--r-- | src/interp/br-op2.boot (renamed from src/interp/br-op2.boot.pamphlet) | 140 | ||||
-rw-r--r-- | src/interp/br-saturn.boot (renamed from src/interp/br-saturn.boot.pamphlet) | 44 | ||||
-rw-r--r-- | src/interp/br-search.boot (renamed from src/interp/br-search.boot.pamphlet) | 30 | ||||
-rw-r--r-- | src/interp/br-util.boot (renamed from src/interp/br-util.boot.pamphlet) | 140 |
7 files changed, 136 insertions, 304 deletions
diff --git a/src/interp/br-con.boot.pamphlet b/src/interp/br-con.boot index 6b77350c..6300c40d 100644 --- a/src/interp/br-con.boot.pamphlet +++ b/src/interp/br-con.boot @@ -1,22 +1,7 @@ -\documentclass{article} -\usepackage{axiom} - -\title{\File{src/interp/br-con.boot} Pamphlet} -\author{The Axiom Team} - -\begin{document} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject - -\section{License} - -<<license>>= -- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -- All rights reserved. +-- Copyright (C) 2007, Gabriel Dos Reis. +-- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are @@ -46,9 +31,6 @@ -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<<license>> import '"bc-util" )package "BOOT" @@ -1343,7 +1325,7 @@ PUT('Union,'documentation,SUBST(MESSAGE,'MESSAGE,'( "\spad{u = v} tests if two objects of the union are equal, that is, \spad{u} and \spad{v} are objects of same branch which are equal.")) (case (((Boolean) $ "A") "\spad{u case a} tests if \spad{u} is of branch \spad{a} of the union.") - (((Boolean) $ "B") + (((Boolean) $ "B") "\spad{u case b} tests if \spad{u} is of branch \spad{b} of the union.")) (coerce ((A $) "\spad{coerce(u)} returns \spad{x} of type \spad{A} if \spad{x} is of branch \spad{a} of the union. Error: if \spad{u} is of branch \spad{b} of the union.") @@ -1403,9 +1385,3 @@ digits2Names s == c CONCAT(str, segment) str -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/interp/br-data.boot.pamphlet b/src/interp/br-data.boot index bb3a1c9a..58c13a83 100644 --- a/src/interp/br-data.boot.pamphlet +++ b/src/interp/br-data.boot @@ -1,22 +1,7 @@ -\documentclass{article} -\usepackage{axiom} - -\title{\File{src/interp/br-data.boot} Pamphlet} -\author{The Axiom Team} - -\begin{document} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject - -\section{License} - -<<license>>= -- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -- All rights reserved. +-- Copyright (C) 2007, Gabriel Dos Reis. +-- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are @@ -46,9 +31,6 @@ -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<<license>> import '"bc-util" )package "BOOT" @@ -804,9 +786,3 @@ purgeLocalLibdb() == --used for debugging purposes only obey '"rm libdb.text" -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/interp/br-op1.boot.pamphlet b/src/interp/br-op1.boot index c37a4481..3d8b4ce3 100644 --- a/src/interp/br-op1.boot.pamphlet +++ b/src/interp/br-op1.boot @@ -1,22 +1,7 @@ -\documentclass{article} -\usepackage{axiom} - -\title{\File{src/interp/br-op1.boot} Pamphlet} -\author{The Axiom Team} - -\begin{document} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject - -\section{License} - -<<license>>= -- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -- All rights reserved. +-- Copyright (C) 2007, Gabriel Dos Reis. +-- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are @@ -46,9 +31,6 @@ -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<<license>> import '"bc-util" )package "BOOT" @@ -1156,9 +1138,3 @@ evalDomainOpPred(dom,pred) == process(dom,pred) where systemError '"unknown atomic predicate form" -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/interp/br-op2.boot.pamphlet b/src/interp/br-op2.boot index 58056718..d8a4a151 100644 --- a/src/interp/br-op2.boot.pamphlet +++ b/src/interp/br-op2.boot @@ -1,22 +1,7 @@ -\documentclass{article} -\usepackage{axiom} - -\title{\File{src/interp/br-op2.boot} Pamphlet} -\author{The Axiom Team} - -\begin{document} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject - -\section{License} - -<<license>>= -- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -- All rights reserved. +-- Copyright (C) 2007, Gabriel Dos Reis. +-- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are @@ -46,9 +31,6 @@ -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<<license>> import '"br-op1" )package "BOOT" @@ -56,24 +38,24 @@ import '"br-op1" --====================> WAS br-op2.boot <================================ --======================================================================= --- Operation Description +-- Operation Description --======================================================================= displayDomainOp(htPage,which,origin,op,sig,predicate, - doc,index,chooseFn,unexposed?,$generalSearch?) == + doc,index,chooseFn,unexposed?,$generalSearch?) == -----------------------> OBSELETE $saturn => displayDomainOp1(htPage,which,origin,op,sig,predicate, - doc,index,chooseFn,unexposed?,$generalSearch?) - $chooseDownCaseOfType : local := true --see dbGetContrivedForm + doc,index,chooseFn,unexposed?,$generalSearch?) + $chooseDownCaseOfType : local := true --see dbGetContrivedForm $whereList : local := nil $NumberList : local := '(i j k l m n i1 j1 k1 l1 m1 n1 i2 j2 k2 l2 m2 n2 i3 j3 k3 l3 m3 n3 i4 j4 k4 l4 m4 n4 ) $ElementList: local := '(x y z u v w x1 y1 z1 u1 v1 w1 x2 y2 z2 u2 v2 w2 x3 y3 z3 u3 v3 w3 x4 y4 z4 u4 v4 w4 ) $FunctionList:local := '(f g h d e F G H) - $DomainList: local := '(D R S E T A B C M N P Q U V W) + $DomainList: local := '(D R S E T A B C M N P Q U V W) exactlyOneOpSig := null index conform := htpProperty(htPage,'domname) or htpProperty(htPage,'conform) - or origin + or origin if $generalSearch? then $DomainList := rest $DomainList opform := which = '"attribute" => @@ -108,7 +90,7 @@ displayDomainOp(htPage,which,origin,op,sig,predicate, constring := form2HtString conform conname := first conform $conkind : local := htpProperty(htPage,'kind) -- a string e.g. "category" - or STRINGIMAGE GETDATABASE(conname,'CONSTRUCTORKIND) + or STRINGIMAGE GETDATABASE(conname,'CONSTRUCTORKIND) $conlength : local := #constring $conform : local := conform $conargs : local := rest conform @@ -134,11 +116,11 @@ displayDomainOp(htPage,which,origin,op,sig,predicate, htSayStandard '"\tab{2}" htSay '"{\em Arguments:}" for a in args for t in rest $sig repeat - htSayIndentRel(15,true) - htSay('"{\em ",form2HtString(a),'"}, ") - htSayValue t - htSayIndentRel(-15,true) - htSay('"\newline ") + htSayIndentRel(15,true) + htSay('"{\em ",form2HtString(a),'"}, ") + htSayValue t + htSayIndentRel(-15,true) + htSay('"\newline ") if first $sig then $displayReturnValue := true htSay('"\newline\tab{2}{\em Returns:}") @@ -169,8 +151,8 @@ displayDomainOp(htPage,which,origin,op,sig,predicate, htSayStandard '"{\em \$} is " htSaySaturn '"{\em \%} is " htSay - $conkind = '"category" => '"of category " - '"the domain " + $conkind = '"category" => '"of category " + '"the domain " bcConform(conform,true,true) htSayIndentRel(-15,true) for [d,key,:t] in $whereList | d ^= "$" repeat @@ -221,11 +203,11 @@ htSayConstructor(key,u) == htSay '"categories " bcConform(first middle,true) for x in rest middle repeat - htSay '", " - bcConform(x,true) + htSay '", " + bcConform(x,true) r is ['CATEGORY,.,:r] => - htSay '" and " - htSayExplicitExports(r) + htSay '" and " + htSayExplicitExports(r) htSay '" and " bcConform(r,true) htSay '"category " @@ -270,7 +252,7 @@ htSayValue t == t is [op,:.] and MEMQ(op,'(Join CATEGORY)) or constructor? opOf t => htSayConstructor(nil,t) htSay('"an element of domain ") - htSayArgument t --continue for operations + htSayArgument t --continue for operations htSayArgument t == --called only for operations not for constructors null $signature => htSay ['"{\em ",t,'"}"] @@ -321,7 +303,7 @@ dbMakeContrivedForm(op,sig,:options) == $NumberList : local := '(i j k l m n i1 j1 k1 l1 m1 n1 i2 j2 k2 l2 m2 n2 i3 j3 k3 l3 m3 n3 i4 j4 k4 l4 m4 n4 ) $ElementList: local := '(x y z u v w x1 y1 z1 u1 v1 w1 x2 y2 z2 u2 v2 w2 x3 y3 z3 u3 v3 w3 x4 y4 z4 u4 v4 w4 ) $FunctionList:local := '(f g h d e F G H) - $DomainList: local := '(R S D E T A B C M N P Q U V W) + $DomainList: local := '(R S D E T A B C M N P Q U V W) dbGetContrivedForm(op,sig) dbGetContrivedForm(op,sig) == @@ -346,10 +328,10 @@ dbChooseOperandName(typ) == x x := $chooseDownCaseOfType => - y := DOWNCASE typ - x := - member(y,$ElementList) => y - first $ElementList + y := DOWNCASE typ + x := + member(y,$ElementList) => y + first $ElementList first $ElementList $ElementList := delete(x,$ElementList) x @@ -389,12 +371,12 @@ getSubstSignature sig == null rest candidates => newsig count := NUMOFNODES newsig for x in rest candidates repeat - trial := fullSubstitute(D,x,sig) - trialCount := NUMOFNODES trial - trialCount < count => - newsig := trial - count := trialCount - winner := x + trial := fullSubstitute(D,x,sig) + trialCount := NUMOFNODES trial + trialCount < count => + newsig := trial + count := trialCount + winner := x newsig addWhereList(D,'is,winner) newsig @@ -412,7 +394,7 @@ getSubstInsert(x,candidates) == --======================================================================= --- Who Uses +-- Who Uses --======================================================================= whoUsesOperation(htPage,which,key) == --see dbPresentOps key = 'filter => koaPageFilterByName(htPage,'whoUsesOperation) @@ -468,7 +450,7 @@ whoUses(opSigList,conform) == hash := MAKE_-HASH_-TABLE() for name in allConstructors() | MEMQ(name,domList) repeat $infovec : local := dbInfovec name - null $infovec => 'skip --category + null $infovec => 'skip --category template := $infovec . 0 found := false opacc := nil @@ -483,7 +465,7 @@ whoUses(opSigList,conform) == template . whereNumber isnt [= $conname,:.] => 'skip signumList := dcSig(numvec,index + 1,numOfArgs) opsig := or/[pair for (pair := [op1,:sig]) in opSigList | op1 = op and whoUsesMatch?(signumList,sig,nil)] - => opacc := [opsig,:opacc] + => opacc := [opsig,:opacc] if opacc then acc := [[name,:opacc],:acc] acc @@ -502,7 +484,7 @@ whoUsesMatch1?(signumList,sig,al) == true --======================================================================= --- Get Attribute/Operation Alist +-- Get Attribute/Operation Alist --======================================================================= koAttrs(conform,domname) == @@ -535,15 +517,15 @@ koOps(conform,domname,:options) == main where -- if relatives? then -- relatives := relativesOf(conform,domname) -- if domname then relatives := --- SUBLISLIS([domname,:rest domname],['_$,:rest conform],relatives) +-- SUBLISLIS([domname,:rest domname],['_$,:rest conform],relatives) -- --kill all relatives that have a sharp variable remaining in them -- for x in relatives repeat --- or/[y for y in CDAR x | isSharpVar y] => 'skip --- acc := [x,:acc] +-- or/[y for y in CDAR x | isSharpVar y] => 'skip +-- acc := [x,:acc] -- relatives := NREVERSE acc -- for (pair := [pakform,:.]) in relatives repeat --- $packageItem := sublisFormal(rest conform,pair) --- ours := merge(fn(pakform,nil),ours) +-- $packageItem := sublisFormal(rest conform,pair) +-- ours := merge(fn(pakform,nil),ours) listSort(function GLESSEQP,trim ours) trim u == [pair for pair in u | IFCDR pair] fn(conform,domname) == @@ -553,7 +535,7 @@ koOps(conform,domname,:options) == main where ----------> new <------------------ u := koCatOps(conform,domname) => u -- 'category = GETDATABASE(conname,'CONSTRUCTORKIND) => --- koCatOps(conform,domname) +-- koCatOps(conform,domname) asharpConstructorName? opOf conform => nil ----------> new <------------------ $infovec: local := dbInfovec conname--------> removed 94/10/24 @@ -565,15 +547,15 @@ koOps(conform,domname,:options) == main where op1 := zeroOneConvert op acc := [[op1,:[[sig,npred,:exposureTail] for [sig,slot,pred,key,:.] in sublisFormal(subargs,u) | - (key ^= 'Subsumed) and (npred := simpHasPred pred)]],:acc] + (key ^= 'Subsumed) and (npred := simpHasPred pred)]],:acc] acc merge(alist,alist1) == --alist1 takes precedence for [op,:al] in alist1 repeat u := LASSOC(op,alist) => - for [sig,:item] in al | not LASSOC(sig,u) repeat - u := insertAlist(sig,item,u) - alist := insertAlist(op,u,DELASC(op,alist)) --add the merge of two alists - alist := insertAlist(op,al,alist) --add the whole inner alist + for [sig,:item] in al | not LASSOC(sig,u) repeat + u := insertAlist(sig,item,u) + alist := insertAlist(op,u,DELASC(op,alist)) --add the merge of two alists + alist := insertAlist(op,al,alist) --add the whole inner alist alist zeroOneConvert x == @@ -631,12 +613,12 @@ koCatAttrsAdd(catform,pred) == then HPUT($if,name,[[argl,simpHasPred npred],:exists]) --======================================================================= --- Filter by Category +-- Filter by Category --======================================================================= koaPageFilterByCategory(htPage,calledFrom) == opAlist := htpProperty(htPage,'opAlist) - which := htpProperty(htPage,'which) + which := htpProperty(htPage,'which) page := htInitPageNoScroll(htCopyProplist htPage, dbHeading(opAlist,which,htpProperty(htPage,'heading))) htSay('"Select a category ancestor below or ") @@ -668,7 +650,7 @@ koaPageFilterByCategory1(htPage,i) == ancestor := (htpProperty(htPage,'ancestors)) . i ancestorList := [ancestor,:ASSOCLEFT ancestorsOf(ancestor,nil)] newOpAlist := nil - which := htpProperty(htPage,'which) + which := htpProperty(htPage,'which) opAlist := htpProperty(htPage,'opAlist) domname := htpProperty(htPage,'domname) conform := htpProperty(htPage,'conform) @@ -677,15 +659,15 @@ koaPageFilterByCategory1(htPage,i) == for [op,:alist] in opAlist repeat nalist := [[origin,:item] for item in alist | split] where split() == - [sig,pred,:aux] := item - u := dbGetDocTable(op,sig,docTable,which,aux) - origin := IFCAR u - doc := IFCDR u - true + [sig,pred,:aux] := item + u := dbGetDocTable(op,sig,docTable,which,aux) + origin := IFCAR u + doc := IFCDR u + true for [origin,:item] in nalist | origin repeat member(origin,ancestorList) => - newEntry := [item,:LASSOC(op,newOpAlist)] - newOpAlist := insertAlist(op,newEntry,newOpAlist) + newEntry := [item,:LASSOC(op,newOpAlist)] + newOpAlist := insertAlist(op,newEntry,newOpAlist) falist := nil for [op,:alist] in newOpAlist repeat falist := [[op,:NREVERSE alist],:falist] @@ -693,7 +675,7 @@ koaPageFilterByCategory1(htPage,i) == dbShowOperationsFromConform(htPage,which,falist) --======================================================================= --- New code for search operation alist for exact matches +-- New code for search operation alist for exact matches --======================================================================= opPageFast opAlist == --called by oSearch @@ -785,9 +767,3 @@ pairlis(u,v) == -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/interp/br-saturn.boot.pamphlet b/src/interp/br-saturn.boot index 212411af..d674f6a0 100644 --- a/src/interp/br-saturn.boot.pamphlet +++ b/src/interp/br-saturn.boot @@ -1,22 +1,7 @@ -\documentclass{article} -\usepackage{axiom} - -\title{\File{src/interp/br-saturn.boot} Pamphlet} -\author{The Axiom Team} - -\begin{document} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject - -\section{License} - -<<license>>= -- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -- All rights reserved. +-- Copyright (C) 2007, Gabriel Dos Reis. +-- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are @@ -46,9 +31,6 @@ -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<<license>> import '"bc-util" )package "BOOT" @@ -1225,16 +1207,16 @@ htShowPageStarSaturn() == --------------> NEW DEFINITION (see br-op2.boot.pamphlet) displayDomainOp(htPage,which,origin,op,sig,predicate, - doc,index,chooseFn,unexposed?,$generalSearch?) == - $chooseDownCaseOfType : local := true --see dbGetContrivedForm + doc,index,chooseFn,unexposed?,$generalSearch?) == + $chooseDownCaseOfType : local := true --see dbGetContrivedForm $whereList : local := nil $NumberList : local := '(i j k l m n i1 j1 k1 l1 m1 n1 i2 j2 k2 l2 m2 n2 i3 j3 k3 l3 m3 n3 i4 j4 k4 l4 m4 n4 ) $ElementList: local := '(x y z u v w x1 y1 z1 u1 v1 w1 x2 y2 z2 u2 v2 w2 x3 y3 z3 u3 v3 w3 x4 y4 z4 u4 v4 w4 ) $FunctionList:local := '(f g h d e F G H) - $DomainList: local := '(D R S E T A B C M N P Q U V W) + $DomainList: local := '(D R S E T A B C M N P Q U V W) exactlyOneOpSig := null index conform := htpProperty(htPage,'domname) or htpProperty(htPage,'conform) - or origin + or origin if $generalSearch? then $DomainList := rest $DomainList opform := which = '"attribute" => @@ -1272,7 +1254,7 @@ displayDomainOp(htPage,which,origin,op,sig,predicate, constring := form2HtString conform conname := first conform $conkind : local := htpProperty(htPage,'kind) -- a string e.g. "category" - or STRINGIMAGE GETDATABASE(conname,'CONSTRUCTORKIND) + or STRINGIMAGE GETDATABASE(conname,'CONSTRUCTORKIND) $conlength : local := #constring $conform : local := conform $conargs : local := rest conform @@ -1317,7 +1299,7 @@ displayDomainOp(htPage,which,origin,op,sig,predicate, coSig := KDR coSig htSayValue t htSayIndentRel(-15,true) - htSayStandard('"\newline ") + htSayStandard('"\newline ") htSaySaturn '"\\" if first $sig then $displayReturnValue := true @@ -1367,8 +1349,8 @@ displayDomainOp(htPage,which,origin,op,sig,predicate, htSayStandard '"{\em \$} is " htSaySaturn '"{\em \%} is " htSay - $conkind = '"category" => '"of category " - '"the domain " + $conkind = '"category" => '"of category " + '"the domain " bcConform(conform,true,true) firstTime := false htSayIndentRel(-15,true) @@ -1911,9 +1893,3 @@ purgeLocalLibdb() == --called by the user through a clear command? -- TERSYSCOMMAND() -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/interp/br-search.boot.pamphlet b/src/interp/br-search.boot index 22650a14..55d449e5 100644 --- a/src/interp/br-search.boot.pamphlet +++ b/src/interp/br-search.boot @@ -1,22 +1,7 @@ -\documentclass{article} -\usepackage{axiom} - -\title{\File{src/interp/br-search.boot} Pamphlet} -\author{The Axiom Team} - -\begin{document} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject - -\section{License} - -<<license>>= -- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -- All rights reserved. +-- Copyright (C) 2007, Gabriel Dos Reis. +-- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are @@ -46,9 +31,6 @@ -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<<license>> import '"bc-util" )package "BOOT" @@ -512,7 +494,7 @@ genSearchSay(pair,summarize,kind,who,fn) == htSay('"{\em 1 ",kind,'"} ") else htSay('"{\em ",count,'" ",pluralize kind,'"} ") - short => 'done + short => 'done if uniqueCount ^= 1 then htSayStandard '"\indent{4}" htSay '"\newline " @@ -1036,9 +1018,3 @@ dbUnpatchLines lines == --concatenate long lines together, skip blank lines -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/interp/br-util.boot.pamphlet b/src/interp/br-util.boot index 9b31f2b5..7fa3fd8f 100644 --- a/src/interp/br-util.boot.pamphlet +++ b/src/interp/br-util.boot @@ -1,22 +1,7 @@ -\documentclass{article} -\usepackage{axiom} - -\title{\File{src/interp/br-util.boot} Pamphlet} -\author{The Axiom Team} - -\begin{document} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject - -\section{License} - -<<license>>= -- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -- All rights reserved. +-- Copyright (C) 2007, Gabriel Dos Reis. +-- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are @@ -46,9 +31,6 @@ -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@ -<<*>>= -<<license>> import '"bc-util" )package "BOOT" @@ -56,7 +38,7 @@ import '"bc-util" --====================> WAS b-util.boot <================================ --======================================================================= --- AXIOM Browser +-- AXIOM Browser -- Initial entry is from man0.ht page to one of these functions: -- kSearch (cSearch, dSearch, or pSearch), for constructors -- oSearch, for operations @@ -70,27 +52,27 @@ browserAutoloadOnceTrigger() == nil ----------------------> Global Variables <----------------------- $includeUnexposed? := true --default setting -$tick := char '_` --field separator for database files +$tick := char '_` --field separator for database files $charUnderscore := ('__) --needed because of parser bug $wild1 := '"[^`]*" --phrase used to convert keys to grep strings $browseCountThreshold := 10 --the maximum number of names that will display - --on a general search + --on a general search $opDescriptionThreshold := 4 --if <= 4 operations with unique name, give desc --otherwise, give signatures $browseMixedCase := true --distinquish case in the browser? -$docTable := nil --cache for documentation table -$conArgstrings := nil --bound by conPage so that kPage - --will display arguments if given -$conformsAreDomains := false --are all arguments of a constructor given? +$docTable := nil --cache for documentation table +$conArgstrings := nil --bound by conPage so that kPage + --will display arguments if given +$conformsAreDomains := false --are all arguments of a constructor given? $returnNowhereFromGoGet := false --special branch out for goget for browser -$dbDataFunctionAlist := nil --set by dbGatherData -$domain := nil --bound in koOps -$infovec := nil --bound in koOps -$predvec := nil --bound in koOps +$dbDataFunctionAlist := nil --set by dbGatherData +$domain := nil --bound in koOps +$infovec := nil --bound in koOps +$predvec := nil --bound in koOps $exposedOnlyIfTrue := nil --see repeatSearch, dbShowOps, dbShowCon -$bcMultipleNames := nil --see bcNameConTable +$bcMultipleNames := nil --see bcNameConTable $bcConformBincount := nil --see bcConform1 -$docTableHash := MAKE_-HASHTABLE 'EQUAL --see dbExpandOpAlistIfNecessary +$docTableHash := MAKE_-HASHTABLE 'EQUAL --see dbExpandOpAlistIfNecessary $groupChoice := nil --see dbShowOperationsFromConform ------------------> Initial Settings <--------------------- @@ -100,14 +82,14 @@ $dbKindAlist := [char 'd,:'"domain"],[char 'p,:'"package"], [char 'c,:'"category"],[char 'x,:'"default_ package"]] $OpViewTable := '( - (names "Name" "Names" dbShowOpNames) + (names "Name" "Names" dbShowOpNames) (documentation "Name" "Names" dbShowOpDocumentation) - (domains "Domain" "Domains" dbShowOpDomains) - (signatures "Signature" "Signatures" dbShowOpSignatures) - (parameters "Form" "Forms" dbShowOpParameters) - (origins "Origin" "Origins" dbShowOpOrigins) - (implementation nil "Implementation Domains" dbShowOpImplementations) - (conditions "Condition" "Conditions" dbShowOpConditions)) + (domains "Domain" "Domains" dbShowOpDomains) + (signatures "Signature" "Signatures" dbShowOpSignatures) + (parameters "Form" "Forms" dbShowOpParameters) + (origins "Origin" "Origins" dbShowOpOrigins) + (implementation nil "Implementation Domains" dbShowOpImplementations) + (conditions "Condition" "Conditions" dbShowOpConditions)) bcBlankLine() == bcHt '"\vspace{1}\newline " @@ -128,7 +110,7 @@ capitalize s == SETELT(res,0,UPCASE res.0) res -escapeSpecialIds u == --very expensive function +escapeSpecialIds u == --very expensive function x := LASSOC(u,$htCharAlist) => [x] #u = 1 => member(u, $htSpecialChars) => [CONCAT('"_\", u)] @@ -158,37 +140,37 @@ htPred2English(x,:options) == fn(x,100) where fn(x,prec) == x is [op,:l] => - LASSOC(op,$precList) is [iprec,:rename] => - if iprec > prec then htSay '"(" - fn(first l,iprec) - for y in rest l repeat - htSay('" ",rename or op,'" ") - fn(y,iprec) - if iprec > prec then htSay '")" - if prec < 5 then htSay '"(" - gn(x,op,l,prec) - if prec < 5 then htSay '")" + LASSOC(op,$precList) is [iprec,:rename] => + if iprec > prec then htSay '"(" + fn(first l,iprec) + for y in rest l repeat + htSay('" ",rename or op,'" ") + fn(y,iprec) + if iprec > prec then htSay '")" + if prec < 5 then htSay '"(" + gn(x,op,l,prec) + if prec < 5 then htSay '")" x = 'etc => htSay '"..." IDENTP x and not MEMQ(x,$emList) => htSay escapeSpecialIds PNAME x htSay form2HtString(x,$emList) gn(x,op,l,prec) == MEMQ(op,'(NOT not)) => - htSay('"not ") - fn(first l,0) + htSay('"not ") + fn(first l,0) op = 'HasCategory => - bcConform(first l,$emList) - htSay('" has ") - bcConform(CADADR l,$emList) + bcConform(first l,$emList) + htSay('" has ") + bcConform(CADADR l,$emList) op = 'HasAttribute => - bcConform(first l,$emList) - htSay('" has ") - fnAttr CADADR l + bcConform(first l,$emList) + htSay('" has ") + fnAttr CADADR l MEMQ(op,'(has ofCategory)) => - bcConform(first l,$emList) - htSay('" has ") - [a,b] := l - b is ['ATTRIBUTE,c] and not constructor? c => fnAttr c - bcConform(b, $emList) + bcConform(first l,$emList) + htSay('" has ") + [a,b] := l + b is ['ATTRIBUTE,c] and not constructor? c => fnAttr c + bcConform(b, $emList) bcConform(x,$emList) fnAttr c == s := form2HtString c @@ -221,11 +203,11 @@ form2HtString(x,:options) == fn(x) where fn x == atom x => - MEMQ(x,$FormalMapVariableList) => STRCONC('"\",STRINGIMAGE x) - u := escapeSpecialChars STRINGIMAGE x - MEMQ(x,$emList) => STRCONC('"{\em ",u,'"}") - STRINGP x => STRCONC('"_"",u,'"_"") - u + MEMQ(x,$FormalMapVariableList) => STRCONC('"\",STRINGIMAGE x) + u := escapeSpecialChars STRINGIMAGE x + MEMQ(x,$emList) => STRCONC('"{\em ",u,'"}") + STRINGP x => STRCONC('"_"",u,'"_"") + u first x = 'QUOTE => STRCONC('"'",sexpr2HtString first rest x) first x = ":" => STRCONC(fn first rest x,'": ",fn first rest rest x) first x = 'Mapping => @@ -290,7 +272,7 @@ dbConstructorKind x == 'domain getConstructorForm name == - name = 'Union => '(Union (_: a A) (_: b B)) + name = 'Union => '(Union (_: a A) (_: b B)) name = 'UntaggedUnion => '(Union A B) name = 'Record => '(Record (_: a A) (_: b B)) name = 'Mapping => '(Mapping T S) @@ -494,8 +476,8 @@ bcConTable u == bcAbbTable u == htBeginTable() firstTime := true - for x in REMDUP u repeat --allow x to be NIL meaning "no abbreviation" - -- for x in u repeat --allow x to be NIL meaning "no abbreviation" + for x in REMDUP u repeat --allow x to be NIL meaning "no abbreviation" + -- for x in u repeat --allow x to be NIL meaning "no abbreviation" if firstTime then firstTime := false else htSaySaturn '"&" if x is [con,abb,:.] then @@ -543,7 +525,7 @@ splitConTable cons == uncond := cond := nil for (pair := [con,:pred]) in cons repeat null pred => 'skip - pred = 'T or pred is ['hasArgs,:.] => uncond := [pair,:uncond] + pred = 'T or pred is ['hasArgs,:.] => uncond := [pair,:uncond] cond := [pair,:cond] [NREVERSE uncond,:NREVERSE cond] @@ -633,7 +615,7 @@ dbGetInputString htPage == --======================================================================= --- Error Pages +-- Error Pages --======================================================================= bcErrorPage u == u is ['error,:r] => @@ -646,7 +628,7 @@ bcErrorPage u == errorPage(htPage,[heading,kind,:info]) == kind = 'invalidType => kInvalidTypePage first info if heading = 'error then htInitPage('"Error",nil) else - htInitPage(heading,nil) + htInitPage(heading,nil) bcBlankLine() for x in info repeat htSay x htShowPage() @@ -688,7 +670,7 @@ dbNotAvailablePage(:options) == htShowPage() --======================================================================= --- Utility Functions for Manipulating Browse Datalines +-- Utility Functions for Manipulating Browse Datalines --======================================================================= dbpHasDefaultCategory? s == #s > 1 and s.1 = char 'x --s is part 3 of line @@ -734,9 +716,3 @@ mySort u == listSort(function GLESSEQP,u) -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} |