Re: select and vecsmall

Bill Allombert <[email protected]>
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <Z5qjB3KxiCpuUsF5@seventeen>
On Wed, Jan 29, 2025 at 10:29:45PM +0100, Denis Simon wrote:
> Hi,
> 
> The function select() doesn't seem to accept Vecsmall.
> 
> v=Vecsmall([1,2,3,4]);
> select(i->i%2,v)
>   ***   at top-level: select(i->i%2,v)
>   ***                 ^----------------
>   *** select: incorrect type in select (t_VECSMALL).
>   ***   Break loop: type 'break' to go back to GP prompt
> 
> Is there any good reason ?

Yes!

You can do [i|i<-v,i%2] though.

Cheers,
Bill.
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.