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

Re: module: How to specify indirect exports positively?



Thank you for the swift response!
Unfortunately, I failed trying to define a macro with said
functionality.It simply won't work, since I can't figure out how to
build the prefixed-identifier out of a concatenation of prefix and
identifier.

I tried using 'string-append' like in this example, which is intented
to import identifier 'var' from module 'A' and assign the name
'prefix.var' to the imported identifier:

(module A mzscheme
  (provide var)
  (define var 1))

(require
 (rename A
         (string->symbol 
          (string-append 
           (symbol->string (quote prefix.))
           (symbol->string (quote var))))
         var))
       
==> require: bad syntax (internal name is not an identifier)

I also experimented with 'namespace-symbol->identifier' and 
'datum->syntax-object' but couldn't get it right.

How should I do this? How does mzscheme-require do this?

Or is there a way to prefix an identifier without using 
'string-append'?

Sebastian