[PATCH] fix an output bug

10 views
Skip to first unread message

oldk1331

unread,
Apr 16, 2019, 9:53:10 AM4/16/19
to fricas...@googlegroups.com
This patch fixes a print bug that mentioned in the
comment of outform.spad:

    paren(blankSeparate([])$OUTFORM)

it only prints the right parenthesis.

The calculation of length of "(CONCATB)" is wrong, when there
is no argument, the output length of the form should be 0
instead of -1.

diff --git a/src/algebra/outform.spad b/src/algebra/outform.spad
index e869023b..b6dc8e4d 100644
--- a/src/algebra/outform.spad
+++ b/src/algebra/outform.spad
@@ -437,7 +437,6 @@
         --   infix, prefix, postfix, matchfix support in OUT BOOT
         --   labove rabove, corresponding overs.
         --   better super script, overmark, undermark
-        --   bug in product, paren blankSeparate []
         --   uniformize integrals, products, etc as plexes.

         cons_form(x : %, l : List(%)) : % == cons(x, l)$List(%) pretend %
diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot
index b12533f5..bb0b8f7e 100644
--- a/src/interp/i-output.boot
+++ b/src/interp/i-output.boot
@@ -460,7 +460,9 @@

 concatWidth [.,:l] == +/[WIDTH x for x in l]

-concatbWidth [.,:l] == +/[1+WIDTH x for x in l]-1
+concatbWidth [.,:l] ==
+    null l => 0
+    +/[1+WIDTH x for x in l]-1

 exptApp([.,a,b],x,y,d) ==
   pren:= exptNeedsPren a

Waldek Hebisch

unread,
Apr 16, 2019, 2:37:07 PM4/16/19
to fricas...@googlegroups.com
> This patch fixes a print bug that mentioned in the
> comment of outform.spad:
>
> paren(blankSeparate([])$OUTFORM)
>
> it only prints the right parenthesis.

OK, please commit.

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