[mercury-users] full and empty lists

Dave Slutzkin dave_slutzkin at yahoo.com
Wed Jan 16 18:10:57 AEDT 2002


 --- David Overton <dmo at cs.mu.OZ.AU> wrote:
> On Mon, Jan 14, 2002 at 11:00:41PM +1100, Dave Slutzkin wrote:
> > 
> > So if I have:
> > 
> >     Line = [_|_]
> > 
> > then I still get the mode benefit?
> 
> Yes.

And indeed I do...  Except in this case:

:- func last_event(timeline::ne_tl_in) = (event::out) is det.

...
	Timeline^next = [_|_] ,   % of type timeline
	E = last_event(Timeline^next) ,
...

Which gives me mode errors.  When changed to:

...
	Temp = Timeline^next ,
	Temp = [_|_] ,
	E = last_event(Temp) ,
...

it works perfectly.

So this mode inference doesn't work completely with field access functions? 
Is this a bug or something not yet implemented?  Or is it something I've
failed to understand...

thanks,

Dave.

http://my.yahoo.com.au - My Yahoo!
- It's My Yahoo! Get your own!
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list