guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rfc: `process-define-module': function -> macro ?


From: Marius Vollmer
Subject: Re: rfc: `process-define-module': function -> macro ?
Date: 21 May 2001 03:21:49 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102

Marius Vollmer <address@hidden> writes:

> For example, we could have a helper function

Sorry, wrong code.  This is the correct one:

    (define (interface-spec->args spec)
      (define (make-keyarg sym key quote?)
        (cond ((or (memq sym spec)
                   (memq key spec))
               => (lambda (rest)
                    (if quote?
                        (list key (list 'quote (cadr rest)))
                        (list key (cadr rest)))))
              (else
               '())))
      (define keys 
        ;; sym     key      quote?
        '((:select #:select #t)
          (:rename #:rename #f)))
      (define (map-apply func list)
        (map (lambda (args) (apply func args)) list))
      (if (not (pair? (car spec)))
          `(',spec)
          `(',(car spec)
            ,@(apply append (map-apply make-keyarg keys)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]