Bill Allombert on Tue, 05 Sep 2023 18:27:18 +0200


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

Re: Questions on PARI/GP formatting


On Tue, Sep 05, 2023 at 06:00:42PM +0200, hermann@stamm-wilbrandt.de wrote:
> There seems to be no PARI/GP formatter tool:
> https://pari.math.u-bordeaux.fr/archives/pari-dev-2308/msg00029.html
> 
> I added "\" suffix for multiline functions.
> Is there a simpler way?

Yes, use brace for multiline functions. No need for \

We offer this tutorial:

<https://pari.math.u-bordeaux.fr/Events/PARI2019b/talks/prog.pdf>

> I added whitespace where it helped me, but overall it is not consistent.
> Are there best practices wrt GP optional whitespace use?
> 
> I use "break", should it be "break()" instead?

Yes, because break has an optional argument.

For historical reason functions without mandatory arguments can be called without ().
This allow to write I^2 instead of  I()^2,  Pi^2/6 instead of Pi()^2/6, etc.


Cheers,
Bill