[m-dev.] module system discussion

Simon Taylor stayl at cs.mu.OZ.AU
Fri Nov 30 19:39:14 AEDT 2001

On 29-Nov-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 27-Nov-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > > Simon wrote:
> > > > 2. `:- transparent_module' and `:- include_transparent_module'
> > 
> > I thought it would be very useful for all those little subclasses that
> > one needs to create in order to map a bunch of classes in a namespace
> > into a mercury module.
> > 
> > Each of these little subclasses could be put inside a transparent
> > subclass.  That way if you imported or used the parent module (say,
> > System__Data) you would get all the transparent submodules automatically
> > "used".
> Another approach that would achieve a somewhat similar effect to this
> without any language extension would be to have the interface tool
> for .NET classes use prefixes such as `ClassName::' in the generated
> predicate names for .NET class methods, rather than using sub-modules.
> Sub-modules would then only be used for .NET namespaces.

I'm not proposing the `:- transparent_module' extension just
for .NET. I am arguing that it is generally good style to qualify
class method names with the class name, and that it is worth adding
a small extension to the module system to make that more convenient.
This hasn't come up before because we haven't used typeclasses much
before, and especially not in large module hierarchies.
> So the `Length' member of the `Constraint' class in the `System.Data'
> namespace would be written as 'System__Data__Constraint::ToObject'
> in Mercury.
> Now when you import the parent module `System__Data', you automatically
> import everything from the `Constraint' class, since the members of
> that class are not a sub-module, they're just ordinary members of the
> `System__Data' module with a special prefix.

Having to 'quote' every class method call is ugly enough that it's
not an acceptable solution to me.

> Now, you may not like this solution,

That's an understatement.

> The words of a Rolling Stones song come to mind...

<snip insipid lyrics>

I don't think taking language design wisdom from drugged-up-to-the-eyeballs
British rock dinosaurs is a good idea.

mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au

More information about the developers mailing list