On Apr 24, 2008, at 2:49 PM, Ryan Newton wrote:
> I'm surprised that I can't find anything on this in the archives.
>
> As far as I can tell, with R6RS we have to keep up tradition (in
> several Schemes) of explicitly exporting every
> accessor/mutator/predicate/constructor for a (syntactic) record type
> definition.  If this issue was discussed, I'd be interested to read
> that discussion.

That's correct.

> Unfortunately, it seems that macros can't save us here because there's
> only one (export ...) clause right at the beginning of the library.
> Otherwise we could perhaps have a define-type-and-export macro for use
> at top-level within a library.

I don't understand what you think you can't do.  You can export and
import record constructors, predicates, accessors, and mutators just
like how you can export any variable and syntax definition.  You can
also export and import record types, condition types, and enumeration
types (several R6RS libraries export some of those already).

Basically, anything you can define, you should be able to export.

Example:

(library (F)
   (export f make-f f? f-x f-x-set!)
   (import (rnrs))
   (define-record-type f (fields (mutable x))))

> Further, it seems that based on the
> definition of a top-level program that it isn't possible to replace
> the library syntax itself with an extended version?

"library" is not a keyword in R6RS, so, yes, you cannot extend it
in the language because it is not in the language defined by R6RS.
The (ikarus) library in Ikarus provides a "library" keyword that
you can use and extend from any internal definition context, but
it's still in experimental stage.  This is in addition to the
"module" keyword whose semantics are derived from Chez, and the
local "import" keyword that can import modules and libraries alike.

Aziz,,,


_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to