[Grace-core] modules

Kim Bruce kim at cs.pomona.edu
Tue Jun 19 14:29:56 PDT 2012


Andrew,

We discussed our approaches to modularity briefly in SF.  A question:  With your implementation essentially using forwarding objects, could it be set up so that objects originating in the same module, but now in a different module could see more of each other?

The simplest example is a Set class supporting public (to the world) methods:

intersect(other:Set) -> Void
union(other:Set) -> Void

but whose representation is as an ordered list, and with a method iterateInOrder which is only visible in the module.  The method iterateInOrder would be used to get an efficient implementation of intersect and union.

Now suppose set1 and set2 are constructed outside the module (say using exported constructors from this class).  Is there a way to set things up so that they execute the efficient implementation of intersection and union, yet the iterateInOrder method is not globally available?  How does that work with your implementation?

Thanks,

Kim

P.S.  That's the kind of thing that my statically-typed module system was designed to allow. I'm hoping your implementation will support it as well.


More information about the Grace-core mailing list