From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: [External] : Re: Hash consing (was: Re: sqlite3) Date: Sun, 19 Dec 2021 00:27:30 +0000 Message-ID: References: <87tufmjyai.fsf@gnus.org> <87lf0nr2b4.fsf@gnus.org> <87fsqvp5ae.fsf@gnus.org> <87bl1jp51y.fsf@gnus.org> <187323C2-81D0-47B6-96C8-3D721EF7C003@mit.edu> <8735mvp454.fsf@gnus.org> <87ilvn1xur.fsf@gnus.org> <87fsqqxsr9.fsf@gnus.org> <679ECACB-C458-4C9E-B26A-72E8D81E0A24@mit.edu> <87ee6afe6b.fsf_-_@yahoo.com> <57E58A64-95E7-4486-BEEC-06DC0E27DA02@gmail.com> <878rwh4glm.fsf@logand.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23314"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: Tomas Hlavaty , Philipp , Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 19 01:28:21 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1myk3o-0005sw-Pt for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Dec 2021 01:28:20 +0100 Original-Received: from localhost ([::1]:58544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myk3m-0001hr-UB for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Dec 2021 19:28:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myk3C-00012a-AQ for emacs-devel@gnu.org; Sat, 18 Dec 2021 19:27:42 -0500 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:30884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myk39-0006Jt-VV for emacs-devel@gnu.org; Sat, 18 Dec 2021 19:27:41 -0500 Original-Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BIBKvwW011025; Sun, 19 Dec 2021 00:27:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=jdlZCoCiKZwlcGflXNV+VxeVQCLdwWPYnTS1WUkXKfQ=; b=rE3d8Z57frPNhqG7kGBYGji6LJKBNBL4kMJSWRaxgLpWNbh3cb142Hm/q3BxHw6DLkRO +O0ZSmR4+QKHFE5wG13YUgq2JBnHnM7LB+squ9OFPlpjA303h0pgDEPlokMZAQ3OwMhd YW0qYNBe0VrLJ6R97Ef+MWIQJJtecpvzBX77nbAmu5XJMeFaKTIS5N9bAuDrkWxTkyDl EY2E/3AWYLJN1tpQ7FyEIkEHKpETvrfakJuEX5gEMTagctfKxWkw+XtImn7WUmOAiTgL 7PWPonFP9cEDjChwS+ykaelBkSvrBZ8tt9ZfyCvXhJEWaJWKCGwCbaQN1MiVU5Roc4zC hg== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3d17h9rxr1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 19 Dec 2021 00:27:35 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BJ0Gt4T058835; Sun, 19 Dec 2021 00:27:34 GMT Original-Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by userp3030.oracle.com with ESMTP id 3d14rsrnky-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 19 Dec 2021 00:27:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=duxlyRJASMTaSwcu8SH01NWl8HV/ck6a3WckXg2oUcdTdO1nQzZWMDMgoVaRzMFHEaaaxrcDb1LjhaeucVmpnbVRdi9na84pbabBKXYWPSts3dOTEQveSQfbG6P3BBL3O6qZp6k2XfWSn3DFQ2YxlPA0Mu7K9YzRGuTDfMrZfxwvF6Qu4e7FTvqNJOqdXOEM7bTmSFXqEUjuTEIYljeN8SQAqITKowUOcG2OnTqEfLK1ePSTn6dINAT3ANOZFgwqNR66g4feakyDzygeHZqGiykMiU+AALVT+F2TkRBGxlgR0CzFeOfFmoqf2eo3btbw9SGnNLAJv0qYfokbTct4bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jdlZCoCiKZwlcGflXNV+VxeVQCLdwWPYnTS1WUkXKfQ=; b=ADqk8UVk1RkT2f4pCoh5Oi5XbM1G0+jTKVRNIbwKdh20RleJ/Dr32BdF2ujXIP/PPk/hjHo5nkeV81djlz8Q6sP9aGftfq2BTJpFRTJOeli0FsSOJWZdhRSzNgAvl+qL2pLGc693Mac88TtuuHC78E2DKmy2LFZelkJIQj39j8i8IqtHuAiKGW8oMAI6KeiLCmLaTyTMuJokvJgb70Ks5d5mUzgbKdze9EtQevoMy/MwypyvkEjmq/a8sJHpNfHQHXKLqoSGjN4Rdei07l9LQv3LxRwsOwByfk5cg3xlRgNpQdYJ8bQbRcuXlS6L0iTMVO2JpzbaG4jQ8B7xZqXfAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jdlZCoCiKZwlcGflXNV+VxeVQCLdwWPYnTS1WUkXKfQ=; b=oOYGe0fEomTU+p8TrN8JQJRULVFIC+3IdGBOZ//XG09/4Ydw1BCnZv+JlmtcejaQClQZP+fZHv2HXzsvS60Yzno7holqLt66Flsk3Z5Ld+wDw2WH8AQcQpfzHj+e2oBdIBCxlecwhn0gFVs1Jm7mjG2Gu48IrNEqmrFheqznaWE= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by SJ0PR10MB4814.namprd10.prod.outlook.com (2603:10b6:a03:2d5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.17; Sun, 19 Dec 2021 00:27:31 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::99a4:696f:5f30:36b3]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::99a4:696f:5f30:36b3%8]) with mapi id 15.20.4801.020; Sun, 19 Dec 2021 00:27:31 +0000 Thread-Topic: [External] : Re: Hash consing (was: Re: sqlite3) Thread-Index: AQHX9GorNxc4h/YfUEaVRchuX4NFLqw48T/w In-Reply-To: <878rwh4glm.fsf@logand.com> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 624e4576-99a0-4a0b-22d1-08d9c2865832 x-ms-traffictypediagnostic: SJ0PR10MB4814:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: smjv4t/rS4XMS2xznS55NN5JjToX6zkiJI2/ZvznIYpZx7oRGmmYwwnuh48Jm1TJ2Lc59fuCOkHGSdLIbKJIKgcuL3vPJzQkam4K4m+rfd23QAhaJnejTqmPEHBIdK2t1IXv3otNhnVRefYdCjjFDEzXOiLNeY1qeZgkLM6tvHdhwRGp42rZh2ftNW5KVj1hJWwLqjy2eEmL+Fx+Wi6BqtHJG9Hgmlv/Cq+P22kXxedyuzhO2BOOvmrU8Ub0dbDZ3nO02HJfxKWyNK74xwGbcwecz15KvZVEvpN5voblSR+9WOMvoX3AoAVprvSopGcX+lTcYdugiSJDsHl9FlAOOo8xJBFRK09ZRdIME2NeRjt1LQ/UKZa+lnG7DKT6ag2YqqizNOMp8lGe/dNmXhLo/Kf1l7EbSFVBtgEHp0pD97oRVMXWoU2kNKnpLS7vsLNVtSATw6QXjUCDGCUn2/5Xz9wBXCZxc14pjczETokKK/6VMQLy69S8sDBtIjYhW9uzm4sY6Vy+XPtrkUaawgj8hafYEL5Xn9IahQ2HIuBU3lc+MB2A6KT4coYoAwsqxEOV48lL58szr3X0OsML3h7KNdeOFOFPyNGybABvEygIJfOooprDa9fUqLmTESTYBflFp4MnSRQZl46ICFiN4cww7sbnw6fJLGzrkDjswW11MXo5WhsATXAzBodRHM+0oL+hTaJeEakiOIqt2umtY903xg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(83380400001)(38070700005)(5660300002)(9686003)(33656002)(26005)(186003)(508600001)(6506007)(110136005)(86362001)(8936002)(316002)(8676002)(2906002)(55016003)(122000001)(7696005)(52536014)(66556008)(64756008)(66476007)(66446008)(71200400001)(66946007)(4326008)(44832011)(38100700002)(76116006); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?PujmyredF8pIYQZVAzkvn0ZlZi95Jwl44L4zVRR47uG0sDqMKSCCmn5oKdy/?= =?us-ascii?Q?huaPTBCoHjwhLdxbPFvMs5YXK+KOeqGEu17R2cf4pGyrs1K/X9fwKZ8fiJUb?= =?us-ascii?Q?FHrK+SpxpgO4QnVrbJWCENMXBGiO1DxRb93kGrlx5qNpOXHWgRRle14U6ob0?= =?us-ascii?Q?AtTluKXoBuxXycZ5to4ghpxLhmxncnwysjIATdG+PO8p2krKbRPFfrV5L4ml?= =?us-ascii?Q?97CrWUkV8u5XntidKs8zCPkoYwoynxxhiypES1fn+rPvmjMt5Qdkjb1tBWeg?= =?us-ascii?Q?OtdFx97BVezm7aBg+T3M5pQE/t0XK2hZiTnyJ0//g796NaaNh5uOfKOlqwfG?= =?us-ascii?Q?7rBqRYRHzhspkBSzXXIRmTBsOGMDFemIcWgRnivAIhFf2ohQcRd4jmiO6dqG?= =?us-ascii?Q?3n5Own3GnpJhjYuFVMLD/lAQR1ioNmzwkDms4lzTghUrAtO93HI70Vr9kjtC?= =?us-ascii?Q?UQeE7wMA10OaQj5EEkK46veG1xF4u+tw50/MvP9qDmMek66QYoIRtaQNV8B4?= =?us-ascii?Q?oRsi6fkYuNhQWLKXM7L3o03rr8UzQd10CNw868cYGI2UnwpqB4z/qbcH/9uw?= =?us-ascii?Q?pHxeZwlXnV8Ygzwe9nvaw4E/R7+88+xvwjCAhXuW5aGUxJdPUX1GElrhOHIN?= =?us-ascii?Q?PT X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 624e4576-99a0-4a0b-22d1-08d9c2865832 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Dec 2021 00:27:30.9473 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: XfWCr1MAhCJgpqRT/OSzlyx8DF0KCM9VZ5EDhbEYcZplqxPSIp6LiaHVEZF5rBS5NM0VTNNlYVs5Za7IvgmoTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4814 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10202 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 mlxscore=0 mlxlogscore=677 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112190000 X-Proofpoint-GUID: uRLDQswo5__H_WQqOCa-MiWpUYdWueR6 X-Proofpoint-ORIG-GUID: uRLDQswo5__H_WQqOCa-MiWpUYdWueR6 Received-SPF: pass client-ip=205.220.165.32; envelope-from=drew.adams@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:282347 Archived-At: > > > > some kind of immutable cons data type. > > > > > > We already have that: No, we don't. > > > for example, the result of evaluating the form > > > '(1 . 2) is an immutable cons cell. No, it's not. > > > The immutability isn't enforced, though: aka There's no immutability. > > > passing such a cons cell to `rplaca' will > > > cause undefined behavior, Demonstration? What's undefined about it? > but typically not signal an error. > > Sorry, but I don't understand what you're saying. > > What's immutable about it? What's undefined > > about using `setcar' or `rplaca' on it? > > (setq x '(1 . 2)) > > (setcar x 3) >=20 > In general, don't do that. Right. Don't mutate that mutable cons. > In Common Lisp, the consequences are undefined. >=20 > In Emacs Lisp, it does not seem to be put that way, > see (describe-function 'quote) I know why one won't want to do it. It's precisely because the cons is NOT immutable, and some code might change it. Code that mistakenly expects a source code occurrence of '(1 . 2) to give you a _new_ cons each time (you think) it's evaluated is bugged, because it need not, and generally does not, do so. That's the point of the warning in `C-h f quote'. There's nothing "immutable" about that cons. "Don't change this cons", and "don't expect '(...) to give you a new cons each time", aren't the same as "it's impossible to change this cons".