On 05/03/2017 01:53 AM, oldk1331 wrote:
>> I would accept map(foo!, L) with a destructive function foo! to modify L
>> in-place, but + isn't such a function.
>>
>> I think that is not a problem of the representation of AssociationList,
>> but rather a problem with the implementation of map.
> 
> Your expression is a little strange -- because 'map' is usually defined as:
>     map(f, l) == map!(f, copy l)

Oh, maybe I didn't express myself well enough. The line

  map(f, l) == map!(f, copy l)

is an implementation detail. It's a good default, but if the context
(speed or violation of some conventions) give rise to another
implementation that doesn't build on map!, then one should consider
reimplementing map inside the respective domain %.

>> Aside from your problem, since we have Rep := Reference List Pair, maybe
>> it makes sense to add
>>
>>   copy x == ref copy deref x
> 
> I was talking about adding that definition into AssociationListAggregate,
> but yes, a more efficient version should be added to AssociationList.

Huh? How can you make a default that uses ref and deref, if in
AssociationListAggregate it is not yet clear what the representation of
AssociationList is? I definitely thing that the above definition belongs
to the domain AssociationList.

>> In general, it is only a copy of the toplevel structure,
>> i.e., a copy of the list structure of association list.
> 
> Yes, that's the convention in Lisp, and I think that's fine.

If it is also the convention for FriCAS, then I can agree with it, but
it should be written down explicitly somewhere so that one can refer to it.

If you want this convention instead of the one I gave in my previous
mail, then your proposal for a new copy (2 level copy) would violate
that convention. So what would you suggest? Changing copy or changing
setelt! ?

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 https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to