for review: assoc_list__map_from_corresponding_lists

David Glen JEFFERY dgj at cs.mu.OZ.AU
Thu Jan 22 17:45:28 AEDT 1998


> Hi,
> 
> Here's a quick change to the library that was suggested to
> help with my layouts change.

Just two comments.

> 	Add a new predicate:
> 		assoc_list__map_from_corresponding_lists
> 	which applies a predicate to the corresponing list
> 	elements before packaging them into an assoc list.

I find the name assoc_list__map_from_corresponding_lists a little confusing.
I don't know what would be better, though.

> +	% assoc_list__map(T, L, M) uses the closure T 
> +	% to transform the elements of L into the elements of M.
> +     
> +:- pred assoc_list__map(pred(X, Y), list(X), list(Y)).
> +:- mode assoc_list__map(pred(in, out) is det, in, out) is det.
> +:- mode assoc_list__map(pred(in, out) is semidet, in, out) is semidet.
> +:- mode assoc_list__map(pred(in, out) is multi, in, out) is multi.
> +:- mode assoc_list__map(pred(in, out) is nondet, in, out) is nondet.
> +

This looks pretty much like list__map/3 to me. Also, there is no implementation
of this in the diff. Maybe you didn't mean to include it?


love and cuddles,
dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) |  Marge: Did you just call everyone "chicken"?
MEngSc student,                 |  Homer: Noooo.  I swear on this Bible!
Department of Computer Science  |  Marge: That's not a Bible; that's a book of
University of Melbourne         |         carpet samples!
Australia                       |  Homer: Ooooh... Fuzzy.



More information about the developers mailing list