From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Rottmann Newsgroups: gmane.lisp.guile.devel Subject: RFD: [PATCH] Fixing symbol printing Date: Tue, 07 Jun 2005 17:30:45 +0200 Message-ID: <87acm2uqu2.fsf@ivanova.rotty.yi.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1118262753 26131 80.91.229.2 (8 Jun 2005 20:32:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Jun 2005 20:32:33 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Jun 08 22:32:22 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dg7CU-000258-GU for guile-devel@m.gmane.org; Wed, 08 Jun 2005 22:30:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dg7JG-0001RN-Vs for guile-devel@m.gmane.org; Wed, 08 Jun 2005 16:37:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dfg5w-0006IZ-EZ for guile-devel@gnu.org; Tue, 07 Jun 2005 11:34:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dfg5v-0006IF-S6 for guile-devel@gnu.org; Tue, 07 Jun 2005 11:34:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dfg5v-0006Gm-Jz for guile-devel@gnu.org; Tue, 07 Jun 2005 11:34:23 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1Dfg65-00065l-HY for guile-devel@gnu.org; Tue, 07 Jun 2005 11:34:33 -0400 Original-Received: (qmail invoked by alias); 07 Jun 2005 15:30:57 -0000 Original-Received: from chello080109053157.14.14.univie.teleweb.at (EHLO garibaldi) [80.109.53.157] by mail.gmx.net (mp028) with SMTP; 07 Jun 2005 17:30:57 +0200 X-Authenticated: #3102804 Original-Received: from ivanova.rhinosaur.lan ([192.168.1.9]) by garibaldi with esmtp (Exim 4.50) id 1Dfg0l-00009p-I5 for guile-devel@gnu.org; Tue, 07 Jun 2005 17:29:14 +0200 Original-Received: from andy by ivanova.rhinosaur.lan with local (Exim 4.50) id 1Dfg2P-0003U1-19 for guile-devel@gnu.org; Tue, 07 Jun 2005 17:30:45 +0200 Original-To: Guile Developers User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.4 (gnu/linux) X-Spam-Score: -5.9 (-----) X-Y-GMX-Trusted: 0 X-Mailman-Approved-At: Wed, 08 Jun 2005 16:37:55 -0400 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:5081 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:5081 --=-=-= Hi! I've developed the following patch, which fixes R5RS-compatibility for printing symbols starting/ending with ':'. The problem with the current behaviour is that you end-up with files that can not be read from other Schemes when you write out such symbols: guile> (write ':foo) (newline) #{:foo}# guile> My patch changes this behaviour to what you'd expect: guile> (write ':foo) (newline) :foo guile> However, when the keywords reader option is set, the old behaviour is re-established, to allow writing out these symbols in "escaped form" so that they can be read back when the prefix keywords reader option is turned on. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=guile-1.6-symbol-print.patch --- guile-1.6.7/libguile/print.c 2003-04-20 20:16:40.000000000 +0200 +++ guile-1.6-1.6.7.mod/libguile/print.c 2005-05-29 18:38:31.000000000 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-1999,2000,2001, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1995-1999,2000,2001, 2003, 2005 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -324,7 +324,9 @@ if (len == 0) scm_lfwrite ("#{}#", 4, port); - else if (str[0] == '#' || str[0] == ':' || str[len-1] == ':') + else if (str[0] == '#' + || (SCM_NFALSEP (SCM_PACK (SCM_KEYWORD_STYLE)) + && (str[0] == ':' || str[len-1] == ':'))) { scm_lfwrite ("#{", 2, port); weird = 1; --=-=-= The patch is against 1.6, since I think that is a genuine bug in Guile (being incompatible with R5RS). Regards, Rotty -- Andreas Rottmann | Rotty@ICQ | 118634484@ICQ | a.rottmann@gmx.at http://yi.org/rotty | GnuPG Key: http://yi.org/rotty/gpg.asc Fingerprint | DFB4 4EB4 78A4 5EEE 6219 F228 F92F CFC5 01FD 5B62 v2sw7MYChw5pr5OFma7u7Lw2m5g/l7Di6e6t5BSb7en6g3/5HZa2Xs6MSr1/2p7 hackerkey.com A. Because it breaks the logical sequence of discussion Q. Why is top posting bad? --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel --=-=-=--