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

indirect-export in macro

This page is part of the web mail archives of SRFI 83 from before July 7th, 2015. The new archives for SRFI 83 contain all messages, not just those from before July 7th, 2015.



I have a question regarding what exactly it is that is being exported.
It might be helpful to pin down the semantics of this more carefully,
although this might be dependent on the pending issue of the macro 
system.  

The document says:

"A indirect-export form, in contrast, can appear in a macro expansion."

Since identifiers introduced by an expansion are distinct 
(in the sense of bound-identifier=?) from library-toplevel
identifiers, would the following work?

  (library "let-div" "scheme://r6rs" 
    (define-syntax make-export
       (syntax-rules ()
         ((_)
          (indirect-export (quotient+remainder)))))
          
    (make-export)
    (define (quotient+remainder n d) ....)
    
or would I have to say instead:

  (library "let-div" "scheme://r6rs" 
    (define-syntax make-export
      (lambda (exp)
       (syntax-case exp ()
         ((k)
          (with-syntax ((source-quotient+remainder
                          (datum->syntax-object (syntax k)
                                                'quotient+remainder)))
            (syntax
              (indirect-export (source-quotient+remainder)))))
              
    (make-export)
    (define (quotient+remainder n d) ....)

Regards
Andre