public inbox for
 help / color / mirror / Atom feed
* odd symbol/string problem in build-guile-gtk
@ 2000-11-16  8:58 Greg Troxel
  0 siblings, 0 replies; only message in thread
From: Greg Troxel @ 2000-11-16  8:58 UTC (permalink / raw)
  To: guile-gtk

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 "*")))
       (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 "*")
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
diff -u -u -r1.1.1.3 build-guile-gtk
--- build-guile-gtk	2000/04/12 19:21:05
+++ 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 <>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-11-16  8:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-16  8:58 odd symbol/string problem in build-guile-gtk Greg Troxel

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).