max.wolf wrote:
> I only wonder, if for typical record usage, "delete" shouldn't remove
> all entries for the given key.
I think that the current version is appropriate, because insert/update
also updates just one entry, not all of them.
> Or at least a "delete_all" should be added.
That's a one-liner:
> delete_all x y = {a | a@(k=>_) = x; k ~== y} if recordp x;
> delete_all {x=>1,y=>2,x=>3} x;
{y=>2}
Only the basic record operations are in the prelude, but as you can see
you can easily add the stuff that you need. That's the nice thing about
having records implemented as matrices, as these already offer some
really powerful operations.
Albert
--
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email: Dr.Gr...@t-online.de, a...@muwiinfa.geschichte.uni-mainz.de
WWW: http://www.musikinformatik.uni-mainz.de/ag