bugKawa - Bugs: bug #40122, Extra whitespaces when displaying...

 
 

bug #40122: Extra whitespaces when displaying numbers

Submitter:  Matthieu Vachon <maoueh>
Submitted:  Fri 27 Sep 2013 01:32:37 AM UTC
   
 
Category:  Scheme language Severity:  3 - Normal
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 27 Sep 2013 07:28:54 AM UTC, comment #1: 

It's an intended feature.  You can argue whether it's a good idea, and there are certainly cases where things get more complicated, but at least for now the feature stays.

The idea is the display is meant to print out numbers so they are human-readable - and write prints them out so they are computer-readable.  Neither of which is the case if (display 2) (display 3) produces "23".  You can't meaningfully create 23 by concatenating 2 and 3.  Note the extra space is only added between numbers (or other "atoms", like booleans and symbols or characters when using write.  If you don't want an extra space, write a string between the numbers - even an empty string will do:
(display 2) (display "") (display 3) ==> "23"

Per Bothner <bothner>
Group administrator
Fri 27 Sep 2013 01:32:37 AM UTC, original submission:  

Consider the following snippet:


(display "[")
(display 1)
(display 2)
(display 3)
(display "]")
(newline)


From my understanding (and it was the case back in the days 1.7.91), this code should print "[123]" in the console. However, it displays "[1 2 3]" instead.

If I'm wrong, just close the issue. I already changed my codebase to not rely on the `display` function. Maybe it's a feature but strings are displayed without spaces, so I think it should be the same with numbers.

I have a test case for this, just waiting to get the bug id. I'm going to attach it right after submitting it.

Regards,
Matt

Matthieu Vachon <maoueh>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #29238:  feature-digit-extra-space-testcase.patch added by maoueh (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-09-27 bothner StatusNone Wont Fix
        Assigned toNone bothner
        Open/ClosedOpen Closed
    2013-09-27 maoueh Attached File- Added feature-digit-extra-space-testcase.patch, #29238

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code