Re: Comments between lines raise syntax error
"Ruud H.G. van Tol" <[email protected]> Sat, 1 Nov 2025 14:29:44 +0100
| Newsgroups | gmane.comp.mathematics.pari.user |
|---|---|
| Message-ID | <[email protected]> |
On 2025-11-01 13:19, Karim Belabas wrote:
> [...] I advise to use { ... } for complicated multi-line statements
instead of a
> line continuation \. The latter works best for a very small number of
lines.
> [...]
>
> {
> level4 = [
> e4,
> /* Level 1 multiplied by Level 3 */
> z1*z5,
> z1*z6,
> z1*z7,
> /* Level 2 multiplied by itself */
> z2*z2,
> z2*z3,
> z3*z3
> ];
> }
> [...]
As an alternative style, also consider:
{ my
( level4 =
[ e4
/* Level 1 multiplied by Level 3 */
, z1 * z5
, z1 * z6
, z1 * z7
/* Level 2 multiplied by itself */
, z2 * z2
, z2 * z3
, z3 * z3
]
);
}
which (for me) works out very clean with many languages and
version-control-systems.
Search on "leading comma format" and "comma first style" for more details.
-- Ruud
P.S. maybe call it "Hungarian punctuation" :)