From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: [bug #31893] ice-9 format produces control characters and non-printable characters for numeric output Date: Sun, 19 Dec 2010 12:14:35 +0000 Message-ID: <20101219-121435.sv20118.81757@savannah.gnu.org> References: <20101215-155834.sv67324.84770@savannah.gnu.org> <20101219-115143.sv20118.32047@savannah.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Trace: dough.gmane.org 1292760887 17910 80.91.229.12 (19 Dec 2010 12:14:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 19 Dec 2010 12:14:47 +0000 (UTC) To: Andy Wingo , "Joel J. Adamson" , bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Dec 19 13:14:43 2010 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PUI9y-0000mE-FX for guile-bugs@m.gmane.org; Sun, 19 Dec 2010 13:14:42 +0100 Original-Received: from localhost ([127.0.0.1]:37795 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUI9x-0000NF-Tg for guile-bugs@m.gmane.org; Sun, 19 Dec 2010 07:14:41 -0500 Original-Received: from [140.186.70.92] (port=58170 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUI9s-0000Jv-V6 for bug-guile@gnu.org; Sun, 19 Dec 2010 07:14:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUI9s-0000sn-0X for bug-guile@gnu.org; Sun, 19 Dec 2010 07:14:36 -0500 Original-Received: from colonialone.fsf.org ([140.186.70.51]:40957 helo=internal.in.savannah.gnu.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PUI9r-0000sh-RO for bug-guile@gnu.org; Sun, 19 Dec 2010 07:14:35 -0500 Original-Received: from [10.1.0.103] (helo=frontend.in.savannah.gnu.org) by internal.in.savannah.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PUI9r-0001qS-Io; Sun, 19 Dec 2010 12:14:35 +0000 Original-Received: from www-data by frontend.in.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1PUI9r-0000Ty-Gx; Sun, 19 Dec 2010 12:14:35 +0000 X-Savane-Server: savannah.gnu.org:443 [10.1.0.103] X-Savane-Project: guile X-Savane-Tracker: bugs X-Savane-Item-ID: 31893 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Safari/531.2+ Epiphany/2.30.2 X-Apparently-From: 90.164.198.39 (Savane authenticated user wingo) In-Reply-To: <20101219-115143.sv20118.32047@savannah.gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4923 Archived-At: Update of bug #31893 (project guile): Status: None => Invalid Open/Closed: Open => Closed _______________________________________________________ Follow-up Comment #2: Actually I think this problem is less exciting. Your format was: ~9,8,,,0g So you are specifying a width of 9 chars, 8 mantissa digits, and an "overflow character" of zero, which also has the effect of making the width a hard limit. Also note that your overflow char is (integer->char 0), not # -- the nul byte, indeed a control character. In this case the width of the whole thing will always be more than 9 characters, so we always splat in the overflow char, which is #nul -- leading to the result given in my first comment. In the future for debugging these things, don't print to the terminal -- print to a string instead. That will be clearer. Cheers, Andy _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/