oldk1331 wrote:
> 
> new$List calls Lisp function directly, instead of repeatedly
> calling "concat".
> 
> This change and the previous map! change probably
> should go into IndexedList, but I really think we should
> remove IndexedList :
> 
> 1. It's not used anywhere beside List. (And probably
> nobody uses it.)
> 2. Unlike arrays, index (elt) is O(n) for lists, so for performance
> reasons, nobody should use index in loops, they should
> use "rest".
> 
> diff --git a/src/algebra/list.spad b/src/algebra/list.spad
> index dcebdb2..e53b314 100644
> --- a/src/algebra/list.spad
> +++ b/src/algebra/list.spad
> @@ -250,6 +250,7 @@
> 
>   Implementation ==>
>     IndexedList(S, LISTMININDEX) add
> +      new(n, e) == MAKELIST(n, e)$Lisp
>        nil()                    == empty()
>        null l                   == empty?(l)
>        cons(s, l)               == concat(s, l)


What is gain from this compared to:

         new(n, e) == [e for i in 1..n]


-- 
                              Waldek Hebisch

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