[PATCH] "#" is only defined for finiteAggregate

3 views
Skip to first unread message

oldk1331

unread,
Jul 22, 2019, 8:06:12 AM7/22/19
to fricas...@googlegroups.com
Function "#" is defined when "% has finiteAggregate", and the
implementation should also fall under this condition, so I fixed
this for URAGG:

--- a/src/algebra/aggcat.spad
+++ b/src/algebra/aggcat.spad
@@ -1466,12 +1466,6 @@
       while not empty? l and i > 0 repeat (l := rest l; i := i - 1)
       empty? l and zero? i

-  #x ==
-      for k in 0.. while not empty? x repeat
-          k = cycleMax and cyclic? x => error "cyclic list"
-          x := rest x
-      k
-
   tail x ==
       empty? x => error "empty list"
       y := rest x
@@ -1521,6 +1515,12 @@
       x

   if % has finiteAggregate then
+      # x ==
+          for k in 0.. while not empty? x repeat
+              k = cycleMax and cyclic? x => error "cyclic list"
+              x := rest x
+          k
+
       last(x, n) ==
           xn := x
           for i in 1..n repeat


Waldek Hebisch

unread,
Jul 22, 2019, 10:16:45 AM7/22/19
to fricas...@googlegroups.com
oldk1331 wrote:
>
> Function "#" is defined when "% has finiteAggregate", and the
> implementation should also fall under this condition, so I fixed
> this for URAGG:

OK, please commit.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages