for review: add nested modules [4/5]

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Mar 2 15:52:51 AEDT 1998


On 02-Mar-1998, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> 
> In type_util.m
> >@@ -375,14 +376,11 @@
> > 
> > type_is_no_tag_type(Ctors, Ctor, Type) :-
> > 	Ctors = [Ctor - [_FieldName - Type]],
> >-	Ctor \= qualified("mercury_builtin", "type_info"),
> >-	Ctor \= qualified("mercury_builtin", "base_type_info"),
> >-	Ctor \= unqualified("type_info"),
> >-	Ctor \= unqualified("base_type_info"),
> >-	Ctor \= qualified("mercury_builtin", "typeclass_info"),
> >-	Ctor \= qualified("mercury_builtin", "base_typeclass_info"),
> >-	Ctor \= unqualified("typeclass_info"),
> >-	Ctor \= unqualified("base_typeclass_info").
> >+	unqualify_name(Ctor, Name),
> >+	Name \= "type_info",
> >+	Name \= "base_type_info",
> >+	Name \= "typeclass_info",
> >+	Name \= "base_typeclass_info".
> 
> You should probably check for the mercury_private_builtin_module part here.
> All occurrences of the type_info, base_type_info and base_typeclass_info
> constructors should be module qualified.

You may be right, but I found it quite difficult to verify this
with 100% certainty.

At worst the code above would mean that the compiler wont't
optimize things quite as well as it could if you happen to name
a type with one of the names above.  I don't think this is
a major problem.

I'll add a comment.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list