login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for SandBoxMyReduce revision 6 of 14

1 2 3 4 5 6 7 8 9 10 11 12 13 14
Editor: Bill Page
Time: 2008/04/07 14:57:23 GMT-7
Note: Waldek's function

changed:
-myred(_$+Integer,[]::List Integer)
myred(+,[])$MyReduce(Integer)

spad
)abbrev package MYRED MyReduce MyReduce(S:Type): with myred: ((S,S)->S,List S) -> S == add -- Waldek's local helper function F ==> (S,S)->S eqfun(f:F,g:F):Boolean == EQ(g,f)$Lisp -- myred(f:(S,S)->S, x:List S):S == if empty? x then if S has AbelianMonoid then eqfun(f,_+$S) => 0$S error "reducing over an empty list needs the 3 argument form" reduce(f, rest x, first x)
spad
   Compiling OpenAxiom source code from file 
      /var/zope2/var/LatexWiki/1041302983496947867-25px001.spad using 
      old system compiler.
   MYRED abbreviates package MyReduce 
------------------------------------------------------------------------
   initializing NRLIB MYRED for MyReduce 
   compiling into NRLIB MYRED 
   processing macro definition F ==> (S,S) -> S 
   compiling local eqfun : ((S,S) -> S,(S,S) -> S) -> Boolean
      MYRED;eqfun is replaced by EQgf 
Time: 0 SEC.
   compiling exported myred : ((S,S) -> S,List S) -> S
****** Domain: S already in scope
augmenting S: (AbelianMonoid)
Time: 0.08 SEC.
(time taken in buildFunctor:  0)
;;;     ***       |MyReduce| REDEFINED
;;;     ***       |MyReduce| REDEFINED
Time: 0 SEC.
   Cumulative Statistics for Constructor MyReduce
      Time: 0.08 seconds
   finalizing NRLIB MYRED 
   Processing MyReduce for Browser database:
--->-->MyReduce((myred (S (Mapping S S S) (List S)))): Not documented!!!!
--->-->MyReduce(constructor): Not documented!!!!
--->-->MyReduce(): Missing Description
------------------------------------------------------------------------
   MyReduce is now explicitly exposed in frame initial 
   MyReduce will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/MYRED.NRLIB/code

axiom
myred(+,[1,2,3])
LatexWiki Image(1)
Type: PositiveInteger?
axiom
myred(+,[])$MyReduce(Integer) >> Error detected within library code: reducing over an empty list needs the 3 argument form