Bill Allombert on Wed, 07 Feb 2024 14:35:34 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: (expression)
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Wed, 7 Feb 2024 14:35:30 +0100
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Delivery-date: Wed, 07 Feb 2024 14:35:34 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1707312931; bh=DsLyjesJ7tjaQiV8yiJSRd9z0jkvr9qz8NYyTU+iNtM=; h=Date:From:To:Subject:References:In-Reply-To:From; b=HBOTV0uTGUmwI85rjQAJrffLJVNTF45x9ajQCrFt5fn3EtBmFVco5mZxikhsp3p1x 0T0jMpf/UpqO54Bp1tAsxsuR0st0vhVsuIodzt91CuJtLZvhMfgqgxk8I8qCOnuz0r K3SW/TP82MthvgxfvgZHs5F9QaRDzAJ8h2Ulvlo2yFBzS1LZmKTcuGB5GNFgdboH5C VLYmIHPHHkfDccpwfJzAtvZ0Hibk9+MBPYyD3g0CwtB3EcwxXTtNr4EKJGaIhclL4v eSRPIzoPVHUoJv0X52ZsHMAI7klwoPU5V+mOsQ005C3qJwWiIgDEuwXc4DhlDIY2zI NjZB0DJALF8vFR4aioOqSoIRqhB1PhLakA/pFTKs1avUmaIO+/ZlR5LpJXH6M0TPM7 dMKWrkN/vMqC1Kikd5sUvmoNZCdp8WLtH022f952Vhq9i3ENiDJXJLR8YN8EOJClGP iKPwSk9pNr/y4L9HPJI9ZShBnpboU8188IPFIe6T3Gzkzbk1TqTxZ64tiF11svwL9R HEWrVVTUk+UzAOxSg3VsAwITx66b6YxANI8mdRpfHXDb3VdaVTHeZzzwARFhubGXN9 yAlBMqz5JT+6H0xwxDoL+cNaTR3uoQQPSMUK/HuLz5VexcEvNyavsSqYwGBfTiMeNe EoVk3VtVPcqTj3VgmdyM5l1A=
- In-reply-to: <2bfac080-2dc0-4295-bddb-4a0eb03d6d75@isolution.nl>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <2bfac080-2dc0-4295-bddb-4a0eb03d6d75@isolution.nl>
On Wed, Feb 07, 2024 at 10:42:10AM +0100, Ruud H.G. van Tol wrote:
>
> Just an innocent example:
>
> ? my(i=3, n=3); n + (while(i--, n++);n)
> *** syntax error, unexpected ')', expecting )-> or ',':
> ...,n=3);n+(while(i--,n++);n)
> *** ^-
>
> ? my(i=3, n=3); n + if(1, while(i--, n++);n )
> %2 = 8
>
>
> Would it be useful to allow/support (expression)s like in the first format?
It is customary to use if(1,...) for that:
my(i=3, n=3); n + if(1,while(i--, n++);n)
The drawback of your suggestion is that users sometime forget to close parenthesis
and allowing ";" inside parenthesis makes that very hard to detect.
Also your example modify a variable inside an expression already involving this
variable. This copy optimiser does not work well with such code.
Cheers,
Bill