Re: bug in simplify_shallow

"Ruud H.G. van Tol" <[email protected]>
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <[email protected]>
On 2023-08-27 14:58, Bill Allombert wrote:
> [...]to be honest I did not remember that listput returned x and it is
> not explicitly documented

? ??listput
listput( list,x,{n}):

    Sets the n-th element of the list list (which must be of type 
t_LIST) equal to x. If n is omitted, or greater than the list length, 
appends x. The function returns the inserted element.

So "returns the inserted element".

-- -- -- --

Made me wonder what it returns when "replacing" a value, either the old 
or the new value.

? my( L= List(), v1= listput(~L,1), v2= listput(~L,2,1) ); [v1, v2, L]
% [1, 2, List([2])]

-- Ruud
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.