[Larceny-users] ERR5RS library form question

Derick Eddington derick.eddington at gmail.com
Mon Apr 6 20:41:30 EDT 2009


On Mon, 2009-04-06 at 13:01 -0400, Lynn Winebarger wrote:
> Is there any ready mechanism for dynamically generating the export
> list of a library form from the expansion of the library form itself?
> I am thinking along the lines of an internal (export <export-spec>
> ...) form.  AFAIK, no such mechanism  is supported now.  It doesn't
> seem like it would be that difficult to support.  Would such an added
> feature be acceptable to the larceny developers?  Any pitfalls?

JTMI, Ikarus offers it (as well as internal (import <import spec>)):

Ikarus Scheme version 0.0.4-rc1+ (revision 1757, build 2009-04-06)
Copyright (c) 2006-2008 Abdulaziz Ghuloum

> (library (def-exports)
    (export def-exports)
    (import (ikarus))
    (define-syntax def-exports
      (syntax-rules ()
        ((_ (name val) ...)
         (begin
           (define name val) ...
           (export name ...))))))
> (library (A)
    (export)
    (import (rnrs base) (def-exports))
    (def-exports (a 1) (b 2))
    (define c 3)
    (def-exports (d 4)))
> (import (A))
> (values a b d)
1
2
4
> 

> [*]   Am I the only Schemer who wants this facility?

No.  I would like it to portably exist, and I know of others who also
do.  IIUC, there was discussion of this issue during the R6RS draft
period but "internal import and/or export" weren't adopted in order to
"keep things simple".  You may find interesting the thread at:
http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/1ba73b8267304876/7dd876d1532853d6

-- 
: Derick
----------------------------------------------------------------




More information about the Larceny-users mailing list