Denis Simon on Wed, 29 Jan 2025 22:56:06 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: select and vecsmall


ok, I will do this. Thanks.
But I thought that this notation was a shortcut for a more complicated select()...

Denis SIMON.

----- Mail original -----
> De: "Bill Allombert" <Bill.Allombert@math.u-bordeaux.fr>
> À: "pari-users" <pari-users@pari.math.u-bordeaux.fr>
> Envoyé: Mercredi 29 Janvier 2025 22:52:07
> Objet: Re: select and vecsmall

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