From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Troxel To: guile-gtk@sourceware.cygnus.com Subject: odd symbol/string problem in build-guile-gtk Date: Thu, 16 Nov 2000 08:58:00 -0000 Message-id: X-SW-Source: 2000-q4/msg00031.html 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