bugKawa - Bugs: bug #36992, Values printing error


bug #36992: Values printing error

Submitted by:  Charles Turner <charlest>
Submitted on:  Sun Jul 29 18:27:19 2012  
Category: NoneSeverity: 3 - Normal
Item Group: Unexpected resultStatus: Wont Fix
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Fri Aug 17 02:13:14 2012, comment #3:

I figure printing:
(values X Y)
should print the same as printing X followed by printing Y.
Similarly evaluating on the command line (or in an eval):
first evaluates and print X, then evaluates and prints Y.
I figure this should be equivalent to evaluating (values X Y).

(display (values X y))
should be the same as:
(display X) (display Y)
and of course
(display "per") (display "bothner")
should print
without a small.

I.e. when printing string or chars, we assume any extra spaces are explicit. However, when printing numbers it doesn't really make sense to just concatenate them, so we add a space.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Thu Aug 2 10:50:05 2012, comment #2:

Just as it would make no sense for (values 1 2) to print 12, it doesn't (IMHO) make a lot of sense for (values "per" "bothner") to print perbothner.

Wouldn't the programmer have intended to return them (and hence have them printed) distinctly if they chose VALUES?

Could you elaborate on this a little bit? Still confused.


Charles Turner <charlest>
Thu Aug 2 06:00:01 2012, comment #1:

The behavior is as intended.
The idea is that strings (and chars and charsequences) are printed as is. However, numbers and other "atoms" are printed with a space separator, since it doesn't make semantic sense to "concatenate" the printed representation of (say) numbers.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Sun Jul 29 18:27:19 2012, original submission:

Here's the current behaviour

#|kawa:1|# (values "ka" "wa")
#|kawa:2|# (values 1 "wa")
#|kawa:3|# (values "ka" 1)
#|kawa:4|# (values 1 2)
1 2

The first three lines are very confusing with less obvious code. The following "fix" sorts out this small example, but it's certainly incorrect

Index: gnu/kawa/functions/DisplayFormat.java
--- gnu/kawa/functions/DisplayFormat.java (revision 7281)
+++ gnu/kawa/functions/DisplayFormat.java (working copy)
@@ -186,7 +186,7 @@
if (out instanceof OutPort
&& ! (obj instanceof gnu.kawa.xml.UntypedAtomic)
&& ! (obj instanceof Values)
- && (getReadableOutput()
+ && (getReadableOutput() || obj instanceof String
|| ! (obj instanceof Char
/* #ifdef use:java.lang.CharSequence */
|| obj instanceof CharSequence

Can assign it to me for now if you like, seems like it's going to require reacquainting myself with how the printer works.


Charles Turner <charlest>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by bothner (Posted a comment)
  • -unavailable- added by charlest (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri Apr 8 17:33:01 2016bothnerStatusNone=>Wont Fix
    Thu Aug 2 06:00:01 2012bothnerAssigned toNone=>bothner

    Back to the top

    Powered by Savane 3.1-cleanup