[plt-scheme] macros that need to eval

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Jan 28 14:53:59 EST 2003

At Tue, 28 Jan 2003 14:17:46 -0500 (EST), Doug Orleans wrote:
> No, I don't think that would work.  In particular, I want to be able
> to pass a class to a unit which defines a subclass of the class.  I
> don't think you can do this with something like struct type
> descriptors, but I'd be happy to see an example.

Short answer: it can't be done, yet.

Currently, a unit can import a struct type, and then use `match'
internally on that struct type. This works only because the `unit/sig'
implementation knows about structures. When a unit imports a structure,
internally the structure name is `define-syntax'ed to a structure
description derived from the import signature.

The next iteration of the unit system will allow you to add
`struct'-like extensions to the signature grammar, so then it will be
possible to do what you want, I think. (An import signature would have
to be required to provide enough static information about the
to-be-imported class.)

It's not currently possible in a unit signature to describe a struct as
derived from some other struct that will exist in the same context, but
not frmo the same signature. Probably you need something like that to
express subtype relations. This will be part of the next `unit'
iteration, too.

Matthew



Posted on the users mailing list.