This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Another macro/module question related to implementing srfis.
Rob Browning <rlb@cs.utexas.edu> writes:
> (define xcons #f)
> (define iota #f)
> ...
>
> (let ()
>
> (cond-expand
> (guile
> (define (check-args ...) ...))
> (rscheme
> (define (check-args ...) ...))
> (else
> ;; R5RS def
> (define (check-args ...) ...)))
>
> (set! xcons
> (lambda (..) ...))
>
> ...)
I was thinking about something like:
(define-syntax define/guile
(cond-expand
(guile
(syntax-rules ()
((define/guile formals body ...) (define formals body ...))))
(rscheme
(syntax-rules ()
((define/rscheme formals body ...) #f)))
...))
(define-syntax define/rscheme
(cond-expand
(guile
(syntax-rules ()
((define/guile formals body ...) #f)))
(rscheme
(syntax-rules ()
((define/rscheme formals body ...) (define formals body ...))))
...))
(let ()
(define/guile (check-args ...) ...)
(define/rscheme (check-args ...) ...))
But, I do agree that it can be useful to have local cond-expand. It's
just that I'm not sure it is useful enough in the general case to
motivate an extension of the basic language.
/mdj