Welcome to the CHICKEN Scheme pasting service

struct->alist added by sjamaan on Sun May 18 15:02:46 2014

(define (struct->alist x)
  (define (f t g x)
    (cons t (alist-map struct->alist (g x))))
  (let-syntax ((check-structs
                (er-macro-transformer
                 (lambda (e r c)
                   (let* ((types (cdr e)))
                     `(,(r 'cond)
                       ,@(map (lambda (t)
                                (let ((pred? (symbol-append t '?))
                                      (tag (symbol-append '< t '>))
                                      (->alist (symbol-append t '->alist)))
                                 `((,pred? x) (f ',tag ,->alist x))))
                              types)
                       (else x)))))))
    (check-structs pie cake)))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which R5RS procedure can be used to concatenate strings?
Visually impaired? Let me spell it for you (wav file) download WAV