Hi Qian,

Patch 1 basically moves all of the function definitions from
IndexedList to List (except, minIndex and maxIndex). Maybe maxIndex can
even be avoided, because it is inherited from the default implementation
of LinearAggregate.

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

I first was a bit sceptical about such a move, because IndexedList
seemed more general to me than List, but, in fact, this patch removes an
interdependency between List and IndexedList (List is currently used in
IndexedList).

I first thought that this patch would be problematic, but seemingly all
index related functions like elt etc. are implemented by category
defaults, so Qian's suggestion works.

Patch 2
In general I like the removal of unnecessary macros and their
replacement by actual function calls. The Lisp reference is still
concentrated in one place (at the beginning).
Maybe, I would reorder the function definition so that all references to
Lisp and all pretend's come first, i.e. move the elt and setelt!
functions further down.

Ralf


On 4/24/19 2:12 PM, oldk1331 wrote:
> Hi all, can we review these two patches please?
> 
> The original thread and attachments are in:
> 
> https://groups.google.com/forum/#!msg/fricas-devel/XtVQA0xxES4/g_8MbobFBgAJ
> 
> 
> On 12/18/18 6:28 PM, oldk1331 wrote:
>> I tried to make this change over a year ago, now I'll try again.
>>
>> The attached 2 patches tries to simplify and cleanup domain
>> IndexedList and List.
>>
>> First patch, it moves almost all functions from IndexedList to
>> List.  Because these functions are not related with index at all.
>>
>> Second patch, it removes many usage of Lisp function call by
>> SPAD function call.  This will not harm performance, because
>> in domain List we can do inline optimization (we can't inline
>> in IndexedList).  There is also a benefit that these function
>> call will be type checked.
> 

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/804df385-179c-6937-039e-0ac9b3a9159e%40hemmecke.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to