> I only now looked more carefully at this part.  Since we already
> have hash function as argument passing also equality is IMO
> quite reasonable.  As was mentioned, if we get hash and equality
> as argument we do not need SetCategory.  So I think that
> Key should be just Type and single argument 'table' should
> be conditional on SetCategory.

Well.. If we drop SetCategory from Key, then the documentation must be
rewritten in some places. I strongly oppose if just the new function is
committed without changing the appropriate places in the whole
documentation, i.e. the part inside )if LiterateDoc ... )endif.

I have created XHashTable simply because the original Table was not
taking care of =$Key and resorted to AssociationList. I haven't looked
now, but the documentation certainly has some places that refer to
equality from Key.

Furthermore, deviating from

  if eq(a, b) then hash(a) = hash(b)

might yield unpredictable results. Maybe not for insertion and
searching, but it should be checked carefully what happens when

  not eq(a,b) and hash(a) = hash(b)

when a or b is deleted from the table, because deleting a might result
in actually removing b from the table.

OK, if Bill requires

  if not eq(a,b) then hash(a) ~= hash(b)

that's not an issue, but still. There should be a thourough revision.

If Bill then uses as eq for Expression that builds on smaller?, i.e.
Comparable, I also oppose. Comparable is there for some technical
reason. It's an arbitrary total order on a (maybe non-totally ordered)
domain. Technically, Bill's idea is probably OK, but here again it comes
to my mind to build Expression(X) as a wrapper domain of underlying
ExpressionRep domains that have equality according to their
representation, i.e. only equal (via =) if rep is equal. Doing this
would also avoid having to change XHashTable, btw. And I guess using =
from ExpressionRep would be faster than checking

  not smaller?(x, y) and not smaller?(y, x)


> BTW: looking at the diff
> I was unable to find implementation of one argument 'table'
> (old one was changed to two arguments)...

The following links should answer your concern about implementation of
table().

https://github.com/hemmecke/fricas/blob/master-hemmecke/src/algebra//xhash.spad#L107
https://github.com/hemmecke/fricas/blob/master-hemmecke/src/algebra//aggcat.spad#L967

Ralf

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to