[Grace-core] Library Structures

Michael Homer mwh at ecs.vuw.ac.nz
Tue May 27 13:48:04 PDT 2014


On 27 May 2014 22:51, "James Noble" <kjx at ecs.vuw.ac.nz> wrote:
>
> On 27/05/2014, at 12:14 pm, Michael Homer <Michael.Homer at ecs.vuw.ac.nz>
wrote:
>
> > Any other file:
> >    import "mysetofmodules" as platform
> >    // Congratulations, you now have a platform object to do with as you
will!
> >    platform.fred.etc.etc
>
> I was just about to say "hey this is (yet another) neat trick that I
didn't think of before"
> (and then repeat the line about basic mechanisms being used in many ways)
>
> and then I though - doesn't this require a circular import?
> platform inherits everything else, and everything else inherits platform?
This only works when you have separated client code and library code, which
I think is the goal here. So you can swap out one list implementation for
another across all your client code at once, but not swap out one piece of
client code for for another. You can have internal dependencies on either
side as well, but platform is an isthmus.
-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20140528/9fcc61c1/attachment.html>


More information about the Grace-core mailing list