Bill Allombert on Mon, 08 May 2023 17:22:14 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: boolean values for [] and List()
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: boolean values for [] and List()
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Mon, 8 May 2023 17:20:56 +0200
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1683559247; c=relaxed/relaxed; bh=zA3/OAh7AnhSWfHWh4tXtAbf19oq/BU4pNZ/4cOLQPs=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; b=akTCaooIZejqPVqHqpq4kZBWZ/uWOtRcsluzQv2/K2npgrqINwcBcsCbLEL7/X4hBEHqNGt2QRiEbFOuYUgnhLiK4sYlcF+ZFtFrzP92+XGnlm1cEoxsD1Zie/ppshVDGtQClfr3nnHUZ0Danhmup+PRR9wOxsp2ymIY3aUlkViyIgzAfrn9Q2PixYm/PXvFPNvT83siZBGuZBhwRWVgVO1G2VK+SDK2s1vaH5iHk45XoJAfS2TLZiMjAgC9rWs+oiuVXopgOOschnglCSoAAX84gc/8nqrdNaHZFEB8T0G2NaDz6T8u7fJH0n3HE3hW8/hRySI9zaNIsPAa+cKbAzGgxMVfhpxMbi5zBbuUg5drmJImtwfTtiKcdO3fCdIAdwFyl/JBWY8Hs7SOIauznl1H2Y9Q1adqhvhGGU3C2LcQutY+hEQ2kEb8rs6hcE9xuddqE1PAi1kf4sNNeW8LXO7xFYr+aOuzLlEHSsrepMFSIE+3ROTC4/+an+cseG47F4JRJ2nr2Ms7fgV5ps2sVc/vmtSylt69TEdn/49/AEyF9+Wk1s4P9qY0bWIvFmIOqbqxe2pMWjIrkPrACdzU8sz2kUUdL5dU0pA2NmNwPchungEj8UsQv6BSvKEK8RcRl5dlatepA/vk9SJD23qEyDDyV9aN9tBzoGdblNEgdC4=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1683559247; cv=none; b=RRvat6gMiQI0sEKbBr3E9w8LxyzKWv6MErUi5iRwL0TuHhv8IlkCqgkOjkZ2v1vUTPad/R0qT20CnbBC2hNFt22T68xWFhqVDC4mrNnjN/qEbCefJgMto9WK5AI1LDMFs4WMCpTbg5f0bKxhEMHwMo3h57oWitcyC9sEvR5PluNOdyVfwM5ECo+RojVYz5sfOqaY2mUDP/qHMjGJMMiszr09ztCDTDHfFn8LyBK3Fsf5NlkqpkUmXeFgcNY+ePa0AHaQAmz+sdqg/anQUBbmhkr21mw4L5kp5Dv8AjaZ3F9YlwOXkXwDy456wbZAs0M1p8FZrpYdIZ3fNUK8Xjcey9pUaS9M9KhEy+R6XVnI/NcYNqR4KNq/nRMDyVQLjCH08USx9AGgWs9G5hXir1DJ6J2J9MpV8Uv9AIpEvY47qYqewZB67FQHuRytKdCVABovhhjebW344fGtkpbywQLU3Whg9T9e/hy5s/5vFcEGxWEejasYINDvWdzzzbdDEZXfKE5LG4n1/W0Q+qn7WjZb3xMGF5dINHR5Sa/x+9wbJhh5Kds5oU5gFoNDssTN5O7uWRZRbbFCCZMICp7RY3ugSwcbCqsb31l6mKm60v7Xvb0rOZMl8RdN10d89ivJopbv4lVYmn5e4Y9GsuWMKViRAeAk++oh7i6peTEfXWk8qYI=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Delivery-date: Mon, 08 May 2023 17:22:14 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1683559247; bh=zA3/OAh7AnhSWfHWh4tXtAbf19oq/BU4pNZ/4cOLQPs=; h=Date:From:To:Subject:References:In-Reply-To:From; b=nXRx5R9HTppvTGIZkPglJfcRMG3AHOuMugI5KENDigHRi4u0m2gqX2dnNW+rBZOAZ Gi5M6F3q9KV/T/5r99jpD2XvN8ZUjx7OIpL01ibR0or3LQXW2AJFUQJkYTdNkuGkLZ YVd/Lv9DI9ox3aZsIbnahEJRhpddVdqrHbqU1KjVa/Pfkpr3F77HPywAT4Hll85S5G aMWzCaNZ8p6qNiUxGzH9MrN0BYAbsoMvnLw4EfD4wzHO6Zt5H+FOodml6Akx3FPxfs n3CggpOLgGI+YGnqjFlFmt2CKGqrMFq1DiHLTHA85YgsNe+RxpdqBiFy4WJwb7tKCC tN/2hS9vLK8eMSbPXBArDwbmIDFb3xH6+d2yAXYG38n9H5ee7FHOviGXNhviUV/1GK C/hqrokmejp6/Ens95/TxCVMckUxhQcqY5EMU0zCJd1kbib+h/Iglxh6yeuA25Mpvl DgBmfxezdDJh8SmAniXKHvhznP6x+AD+qVNGjOvp+xprCIQnTfaNIJXeH3IhRSgtvn lfd/JsMaq7+7VAlePa7sABdRlmkWj/1B9oB8/vgQQsjolNmQa4M+QtcdSGpNXCf3NV fERQRUga5RYrp0M+18V8K3Qr87H9tEUM6wfi9UM6IyEBXxoiLcC8gKX6x5kL8EzJEk 0rLD7uO8jFUVTipHpBBG29H4=
- In-reply-to: <CAJkPp5MrQ64o4vJR=7BANfEJRWtSAosjs-FGQHQozoNsHjbXtA@mail.gmail.com>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <CAJkPp5MrQ64o4vJR=7BANfEJRWtSAosjs-FGQHQozoNsHjbXtA@mail.gmail.com>
On Mon, May 08, 2023 at 10:55:16AM -0400, Max Alekseyev wrote:
> Why is there a discrepancy between empty vector and empty list?
>
> ? if([], print("yes"), print("no"))
> no
> ? if(List(), print("yes"), print("no"))
> yes
This is because List() is not an arithmetic type: List()-List() is not defined:
? List()-List()
*** at top-level: List()-List()
*** ^-------
*** _-_: forbidden addition t_LIST + t_LIST.
so it is not subject to the 'x-x == 0' rule.
But in both case, it is better to do
if(#[],...)
if(#List(),...)
Cheers,
Bill.