unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: prj@po.cwru.edu (Paul Jarc)
Subject: another symbol-printing fix
Date: Mon, 01 Dec 2003 19:45:40 -0500	[thread overview]
Message-ID: <m3fzg43v3p.fsf@multivac.cwru.edu> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 498 bytes --]

Squashing more bugs for weird symbol names.

	* print.c (scm_print_symbol_name): Handle #{`foo}#, #{,foo}#,
	and #{.}# specially.

This is still not complete, though.  There are still problem cases
like #{0.0}#, #{-i}#, etc.  Rather than trying to duplicate all the
number-detection logic from scm_lreadr, maybe it would be best to
handle just the few non-numeric special cases, and then try
scm_i_mem2number(); if that returns non-#f, treat the symbol name as
weird.  I'll work on a patch.


paul

[-- Attachment #2: print-symbol-special.patch --]
[-- Type: text/x-patch, Size: 699 bytes --]

Index: guile-core/libguile/print.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/print.c,v
retrieving revision 1.157
diff -u -r1.157 print.c
--- guile-core/libguile/print.c	30 Nov 2003 00:57:14 -0000	1.157
+++ guile-core/libguile/print.c	2 Dec 2003 00:39:33 -0000
@@ -324,7 +324,8 @@
    * name we've looked at so far. */
   int all_digits = 1;
 
-  if (len == 0 || str[0] == '\'' || str[0] == ':' || str[len-1] == ':')
+  if (len == 0 || str[0] == '\'' || str[0] == '`' || str[0] == ',' ||
+      str[0] == ':' || str[len-1] == ':' || (str[0] == '.' && len == 1))
     {
       scm_lfwrite ("#{", 2, port);
       weird = 1;

[-- Attachment #3: Type: text/plain, Size: 136 bytes --]

_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile

             reply	other threads:[~2003-12-02  0:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-02  0:45 Paul Jarc [this message]
2004-01-05 18:55 ` another symbol-printing fix Paul Jarc
2004-01-10 22:28   ` Marius Vollmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3fzg43v3p.fsf@multivac.cwru.edu \
    --to=prj@po.cwru.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).