[mercury-users] Exceptions and unique modes

Peter Ross peter.ross at miscrit.be
Thu Feb 22 01:15:18 AEDT 2001


On Thu, Feb 22, 2001 at 12:21:47AM +1100, Fergus Henderson wrote:
> > Imagine the following situation:
> > 
> > :- pred p(list(resource_requests)::in,
> >         map(key, resource)::di, map(key, resource)::uo) is det.
> > 
> > p([], Map, Map).
> > p([R | Rs], Map0, Map) :-
> >     allocate_resource(R, Resource),
> >     get_key(Resource, Key),
> >     map__det_insert(Map0, Key, Resource, Map).
> 
> `Rs' is a singleton variable.  I think you missed a recursive call
> here.  Probably you intended that last line to be
> 
> 	    map__det_insert(Map0, Key, Resource, Map1),
> 	    p(Rs, Map1, Map).
> 
Yes I did.
--------------------------------------------------------------------------
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