RE: Libraries and hierarchies

It also gives the advantage that modules can be moved in the hierarchy (by a command-line flag or whatever) specifically to support whatever a particular program happens to require.
Would the following be possible under your proposal:
module M1.A imports Collections.Foo and only works with version 1 module M2.B imports Collections.Foo and only works with version 2 module C imports M1.A and M2.B
Could we compile/use M1.A with Graphics.UI mapped to Graphics.UI.v1 and M2.B with Graphics.UI mapped to Graphics.UI.v2 and then correctly compile module C?
Yes, absolutely. There are issues about exactly what the programmer would have to do to make this happen: under the story I had in mind you would have to fiddle with a user-local package.conf file to change the mapping. Perhaps command-line flags could be added to make this more convenient, though. Cheers, Simon

On Mon, 4 Aug 2003, Simon Marlow wrote:
There are issues about exactly what the programmer would have to do to make this happen: under the story I had in mind you would have to fiddle with a user-local package.conf file to change the mapping. Perhaps command-line flags could be added to make this more convenient, though.
The advantage of command-line flags would be that a library author could write their code to import Collections.Foo without any version specifier, and then distribute it with a Makefile or whatever that made Collections.Foo use the appropriate version number if there was a compatibility issue. Then it would only need to be changed in one place as the required version changed. Cheers, Ganesh
participants (2)
-
Ganesh Sittampalam
-
Simon Marlow