[m-rev.] high level data: optimize single-functor case

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Dec 6 20:26:21 AEDT 2001


On 05-Nov-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> On 04-Nov-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > +++ compiler/hlds_data.m	4 Nov 2001 08:31:37 -0000
...
> > +	% Return the primary tag, if any, for a cons_tag.
> > +	% A return value of `no' means the primary tag is unknown.
> > +	% A return value of `yes(0)' means the primary tag is always zero.
> > +:- func get_primary_tag(cons_tag) = maybe(int).
> 
> I'm unclear on what "always zero" means.  Either "always" is redundant
> or I am misunderstanding what this mean.

"always" is redundant.  I'll delete it.

> Why special case `yes(0)' in this documentation?

Hopefully the following explains it better.

Index: hlds_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_data.m,v
retrieving revision 1.61
diff -u -d -u -r1.61 hlds_data.m
--- hlds_data.m	4 Nov 2001 14:30:34 -0000	1.61
+++ hlds_data.m	6 Dec 2001 09:24:08 -0000
@@ -446,7 +446,8 @@
 
 	% Return the primary tag, if any, for a cons_tag.
 	% A return value of `no' means the primary tag is unknown.
-	% A return value of `yes(0)' means the primary tag is always zero.
+	% A return value of `yes(N)' means the primary tag is N.
+	% (`yes(0)' also corresponds to the case where there no primary tag.)
 :- func get_primary_tag(cons_tag) = maybe(int).
 
 	% Return the secondary tag, if any, for a cons_tag.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list