public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
From: Greg Troxel <gdt@fnord.ir.bbn.com>
To: guile-gtk@sourceware.cygnus.com
Subject: odd symbol/string problem in build-guile-gtk
Date: Thu, 16 Nov 2000 08:58:00 -0000	[thread overview]
Message-ID: <rmig0krrh08.fsf@fnord.ir.bbn.com> (raw)

I am using guile from cvs (yesterday) and gnome-guile from cvs
(today) on FreeBSD 3.3 i386.

build-guile-gtk blew up with type errors, complaining in string-append
that GdkColormap was the wrong type (append with "*"):

  (define (register-boxed-converter name options)
    (let ((iname (info-name name))
	  (sname (string-append name "*")))
      (register-type 
       name
       (make-type name sname
		  (lambda (x)
		    (@@ "sgtk_valid_boxed (~a, &~a)" x iname))
		  (lambda (x)
		    (@@ "(~a)sgtk_scm2boxed (~a)" sname x))
		  (lambda (x copy)
		    (@@ "sgtk_boxed2scm (~a, &~a~a)"
			    x iname (if copy ", 1" ", 0")))
		  'fit-for-list #t
		  'conversion (get-opt-val options 'conversion #f)))))


After reading the code, I came to the conclusion that build-guile-gtk
expected symbols to be silently converted to strings where
appropriate.  I wondered how info-name could have worked, but found
that canonicalize uses string->list.  Guile from August 18 does:

guile> (string-append 'GdkColormap "*")
"GdkColormap*"
guile> (string->list 'GdkColormap)
(#\G #\d #\k #\C #\o #\l #\o #\r #\m #\a #\p)

whereas current guile does

guile> (string-append 'GdkColormap "*")
standard input:3:1: In procedure string-append in expression (string-append (quote GdkColormap) "*"):
standard input:3:1: Wrong type argument: GdkColormap
ABORT: (wrong-type-arg)
guile> (string->list 'GdkColormap)
(#\G #\d #\k #\C #\o #\l #\o #\r #\m #\a #\p)

R5RS does not appear to require string-append or string->list to work
with symbols.  Guile was changed on 2000/8/26 (1.36, mdj) to no longer
accept symbols.

I made the following patch, which is admittedly quite kludgy, because
I don't grok build-guile-gtk well enough to know how to fix it right.
With that and some other small issues (believed unrelated), I could
build guile-gtk.

Index: build-guile-gtk
===================================================================
RCS file: /IR-CVS/guile-gtk/build-guile-gtk,v
retrieving revision 1.1.1.3
diff -u -u -r1.1.1.3 build-guile-gtk
--- build-guile-gtk	2000/04/12 19:21:05	1.1.1.3
+++ build-guile-gtk	2000/11/16 16:06:36
@@ -298,6 +298,13 @@
 				    (string (car chars)))
 		 (cdr chars) (char-lower-case? (car chars)))))))
 
+(define guile-string-append string-append)
+(define (string-append . args)
+  (apply
+   guile-string-append
+   (map (lambda (s) (if (symbol? s) (symbol->string s) s))
+	args)))
+
 (define (syllables->string syls del)
   (cond ((null? syls)
 	 "")


        Greg Troxel <gdt@ir.bbn.com>

                 reply	other threads:[~2000-11-16  8:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to=rmig0krrh08.fsf@fnord.ir.bbn.com \
    --to=gdt@fnord.ir.bbn.com \
    --cc=guile-gtk@sourceware.cygnus.com \
    /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).