> I don't understand. If I programmed a domain Pair(A, B) and made its Rep
> equal to
>
>   Record(first: A, second: B)
>
> would the compile produce something more complicated than a cons pair
> for the representation?

First, functions in Pair can use Rep.first, Rep.second, that is fast.
Outside Piar, 'first pair' might be a SPADCALL, but that can be
optimized by lisp macro:  first pair == QCAR(pair)$Lisp

> Note that one can also implement "no duplicates" by just adding a new
> (key, value) pair in front of the list and never show duplicate keys in
> the output (although they are still there in the representation). Only
> when a key is deleted, then *all* keys have to be removed from the
> datastructure.

> It's certainly a question of how exactly AssociationList should behave.
> That is why a proper specification is needed.

Stop thinking AlistAgg as a table, think it as a list. AlistAgg is Lisp's alist,
it allows duplicates.

> i.e., for most cases Table is implemented as an AssociationList with
> linear access time.
>
> So if we agree on duplicate keys in AssociationList, then Table might be
> in danger.

I think in most cases Table is not implemented as ALIST, I checked that.
Table only exports TableAgg, if you use only functions from TableAgg,
you can't create a duplicated key, so there's no problem using ALIST
as Rep of Table.

> But it seems that you cannot easily remove TableAgg from AListAgg,
> because, ALIST is used as the implementation of Table as I wrote in my
> last mail.

Yes it can.  Simply move the TableAgg specific functions from ALIST to
Table (we might need a layer there).  And that's my next step.

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to