(define-module (guile-syntax colon-keyword) #:export (colon-keyword)) (define (colon-keyword exp) (let lp ((lst exp)) (cond ((null? lst) exp) ((pair? lst) (set-car! lst (colon-keyword (car lst))) (if (pair? (cdr lst)) (lp (cdr lst)) (begin (set-cdr! lst (colon-keyword (cdr lst))) (lp '())))) ((symbol? lst) (let ((str (symbol->string lst))) (if (char=? (string-ref str 0) #\:) (symbol->keyword (string->symbol (substring str 1))) lst))) ((vector? lst) (let lp2 ((i 0)) (if (>= i (vector-length lst)) lst (begin (vector-set! lst i (colon-keyword (vector-ref lst i))) (lp2 (+ i 1)))))) (else lst))))