From 8ba169bea0a3e9eed9593bdb4832d71a0f5f19a4 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 22 Jan 2008 01:01:51 +0000 Subject: Fix AW/102 * interp/iterator.boot (getIdentity): Properly identity the algebra empty list. --- src/ChangeLog | 7 +++++++ src/interp/iterator.boot | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a574d36e..8a3433ae 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2008-01-21 Gabriel Dos Reis + Waldek Hebisch + + Fix AW/102 + * interp/iterator.boot (getIdentity): Properly identity the + algebra empty list. + 2008-01-21 Gabriel Dos Reis Apply patch byStephen Wilson < diff --git a/src/interp/iterator.boot b/src/interp/iterator.boot index 5431b3d9..ff88a8e8 100644 --- a/src/interp/iterator.boot +++ b/src/interp/iterator.boot @@ -74,9 +74,13 @@ compReduce1(form is ["REDUCE",op,.,collectForm],m,e,$formalArgList) == [untilCode,.,e]:= comp($until,$Boolean,e) finalCode:= substitute(["UNTIL",untilCode],'$until,finalCode) [finalCode,m,e] - + +++ returns the identity element of the `reduction' operation `x' +++ over a list -- a monoid homomorphism. getIdentity(x,e) == - GETL(x,"THETA") is [y] => y + -- The empty list should be indicated by name, not by its + -- object representation. + GETL(x,"THETA") is [y] => (y => y; "nil") numberize x == x=$Zero => 0 -- cgit v1.2.3