> Yes it is resonable.  My only doubts is that as you
> noticed there is only one place that currently uses
> two argument 'last', so I am not sure how useful
> is extending this functionality by adding new 'last'.

This is how I notice this:

I read about an algorithm that "scan once to find the
nth last element", the solution is to use 2 pointers.
I tested and in the List case, it's much slower than
elt(a, #a - n).

So, the reason to have these functions which operates
from backward is to achieve performance by using the
scan once algorithm.  I don't know for aggregates other
than List, if it's actually faster.

Other than performance concerns, it's nice to have
functions to operate from backwards instead of writing
one's own.  I was thinking : delete(a, n), when n < minIndex a,
delete (minIndex(a) - n)th last element.

Removing last few elements is pretty common in statistic,
I think.

-- 
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