Re: sweeter syntax

[email protected] Sun, 21 Dec 2025 17:46:50 +0100
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <[email protected]>
On 2025-12-21 15:38, Ruud H.G. van Tol wrote:
> Maybe make [3..10, 2] return [3,5,7,9].
> 
> Maybe make [3..10, Mod(1,2)] return [3,5,7,9].
> 
> -- Ruud
> 
The first is difficult to understand without a keyword "step".

The second is shorter, but GP already has alternative set notation …
https://pari.math.u-bordeaux.fr/pub/pari/manuals/2.17.2/users.pdf#page=25

? [k|k<-[3..10],k%2]
[3, 5, 7, 9]
?

… which is much more powerful because you can plugin anything you like.

Regards,

Hermann.