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: Conditional binding and testing of `lexical-binding' Date: Mon, 3 Jan 2022 03:31:41 +0000 Message-ID: References: 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="7068"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: LdBeth Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 03 04:33:15 2022 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 1n4E5z-0001cz-4t for ged-emacs-devel@m.gmane-mx.org; Mon, 03 Jan 2022 04:33:15 +0100 Original-Received: from localhost ([::1]:41340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4E5x-0005Qm-Lt for ged-emacs-devel@m.gmane-mx.org; Sun, 02 Jan 2022 22:33:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4E4i-0004fx-Mh for emacs-devel@gnu.org; Sun, 02 Jan 2022 22:31:56 -0500 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:10970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4E4g-0006wX-7h for emacs-devel@gnu.org; Sun, 02 Jan 2022 22:31:56 -0500 Original-Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 2031TX2Z027598; Mon, 3 Jan 2022 03:31:49 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=78gnMBlrxxggewrwhWLZvlez7Pf1kP60OBfsehSVGNE=; b=RcE8354Vu+LDxUYYEA4KrlrBRd7T1nOOPW6tQm/hvp+a9+p+i41Taffk/mR+jGVLsgN9 s2/rpWcWjsy+WjAJYjibTtkIRpwp/MYD3WoEbmOi8gFkqvkUr665C0UcfUdI1pb6eVBO Jmc8tw8vHKFHA3g87xBUm91fna5mLBAB8aza8Gnbc3fjzqGtYb/JYLfUpKbLyDdZtbgA l138CBAxN5IDmbwMSNwcsDFotYzSCxURHi3hNP3Zp4NpjDrq6HpDksQwNhhfjIWvDz9b w87xNtn9X9RNQl8BuKpm9hd+HEn70FoEgdUobGaduNuTtKdiilMEEQzr8FEy8lfDmjsm cg== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3dadj1su0k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jan 2022 03:31:49 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 2033Q0tm129283; Mon, 3 Jan 2022 03:31:47 GMT Original-Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2107.outbound.protection.outlook.com [104.47.58.107]) by aserp3030.oracle.com with ESMTP id 3dad0bj89u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Jan 2022 03:31:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cVyQ44MV9Qz5aZ/7oP68m6bCcHp4AQk8dNv9rtkWEciBmW2i0pH6vg3Kuojcwkz9bFfodRicUylgBjlhz1+QkMvhUX08zEXuhh+f1w7Q/tZm/Nvq3mUTinNLzIsTbOASiNBtgq4Vu0GJqV5zwK2QCeVETb5BDSbsviVTZSsyE2jkBPxWkU5uRw/57t0oqjoqOF5vZDDcXr6KLEF0fy4R6vB0LgikJMZsVmzOG/ImMAB5ZJIBzPC0QejjdJbdyua2a2N49i11WdTLGg+G+5tXp5lDtsRIzCzHduvPt4gg8fKkaz0nW1fLgjY1tSHCAdW6l/34fZ7OzI4Ci85gxCO2JQ== 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=78gnMBlrxxggewrwhWLZvlez7Pf1kP60OBfsehSVGNE=; b=hwir+0Ejul9eqLDy16Xh/r4xk5JQ02l8QJi3LUS4EZFTMG8jf8cKfIFsgSGDdUA/hAAbK56CN4AK+ir5b0/DQkGPWxQIREoybSMx9j7FNHtTPjNSDagPGTJm4Re6EyLiSTpwYU/kQPezlS4ertDNkT3ufha0Aua3dNK0NODPpiJxAGed03SXGiMWPdRbmtZTDXEkoS+vaJ58wSKi8td8ODDdRHQUQLDbxnJ//biqMMbHP3HXGlqdijr0iQoFutShb9aWACrReqN9/htRKLWDiwRpoV6zfI3so1pkhF+Wx2caCMqRmbXlJhmyEZKNm2i8ja7LbFmX5v5yHzZxJj4GTA== 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=78gnMBlrxxggewrwhWLZvlez7Pf1kP60OBfsehSVGNE=; b=DVTm6OdPdOXVAoJLr2H8Q487aczhC2q7YLKlFIWMrvEMBPoNwvYWOy5ngizARxEzmiZuyNLcyzzNLYmkP59ZabAaPfNpesAC97DEZM6qtlVmMmLfylToId8dgYqypy5RtnTlmTezGFPMgEHHxikPwHv3hpcmBKr/V2jR1gRESIA= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BY5PR10MB3858.namprd10.prod.outlook.com (2603:10b6:a03:1b2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.13; Mon, 3 Jan 2022 03:31:42 +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%7]) with mapi id 15.20.4844.016; Mon, 3 Jan 2022 03:31:41 +0000 Thread-Topic: [External] : Re: Conditional binding and testing of `lexical-binding' Thread-Index: AQHYAE9jK4Q2ueJjUUSbYBbdx5CmCqxQnpcA In-Reply-To: Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ccefe1ab-adae-4637-84e3-08d9ce698f3d x-ms-traffictypediagnostic: BY5PR10MB3858:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wDqFppajZdqYpaQGYkQih8/u87OpJG0LN4Pp8hadWYYpPlpvt2Fzlwge5CYSc1TWue1viXt5g7kMuNuqf5KVOci4abu5RT7XZtMe7L+PbaC3t0YsIpt81EK3ZmqQ9Yl9y6QgYafJIGE+hAYw/1omgukhoSKNcNDba7HG5KDcRXnhZ4Hs0xUtnOyv2DKMY3bqoMD2I3s/WohLeiY/aMg/My9gGRxJfHv85/fkhdfp8EohOOnZ8eaHt2U8ulJ8ew7t3sV7eMet7rpKC2MxE7aZN4T3pEXCOmQmjAWVwcF7Xb8DBYaPjnGVQH+kQ2dVoTKcFECa/RV6x/OkwyA0ojP23vTQ0LHGtZaIHYKn6azKWYkkeL8c+tFjsAlXZA/eN8RNISr4KGIXQsc5cAFO91yY8VAJUBiYsssgi2pt7qo3lje+UJeQ7gHjQCNMNAubPOu00Spg2RSbScydck6OZ/D82nHhx2qGabut2s2zJtkzW2Yo4r4Tu08h9kDis3eyOnbV7/noTBqKVT7MppcDZbqxaeeXi9mweDHLekiFlpVa0DLn+CwhkY9M8nII9GCvEMKhUTtVoohbXTlQyMbt5qJ2TlhATYvVaevcJHkMigZYNkqtS9ReDd75rG/axmDjQlaEcgtNeblQJ/584h4zohVS0gBwztGFm9e+jSoT1tUbJtZljOwxum54ctHJBgjzYhhVtXTTEfoP6XE8F4OIDwNVzFLAIh5htXeryookgcC5KQw= 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)(8676002)(508600001)(4326008)(55016003)(66946007)(64756008)(66556008)(66476007)(33656002)(66446008)(186003)(76116006)(5660300002)(6506007)(26005)(44832011)(8936002)(2906002)(9686003)(86362001)(6916009)(38100700002)(122000001)(52536014)(316002)(38070700005)(71200400001)(7696005)(81973001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rPOdDcbcAnkjOLsNS/rVK+LA4kaOlZ3Zf+moAhjuSHTR9fXu3OglyZYux41S?= =?us-ascii?Q?S1nR/jvcjw6+ZG4dUzHDCFXe8qskoBzPfSTn73OcTghZMv2RtOTg+OB8n/vK?= =?us-ascii?Q?42nIxRBrxMxqlqR1hcg8CB72JhPvZq9JyLn+i9/7+Ga6pVYdetxKg2LonOIs?= =?us-ascii?Q?zPT9WqCiKMZmJe+6LjwKQcv5wu4WN1ryhRPsryfCOKOIZAt/FWszoJKtORyc?= =?us-ascii?Q?lfTYsel5NLUZcWQWzIXyvcwty61KhTgX3RNc2N8orEjBsjXypd0TtQrB9Ijv?= =?us-ascii?Q?gDA4QCTxNzz0lRe1SmBtXEFf0NwHTR8Jtp/35oOMYoAV5Jsvblb+C9NEjKrV?= =?us-ascii?Q?Vqs/rtK+p/u2uGHnZ82kvQWiX4bRNOTIWBGjJAGLCqZzubk5+6dStDeMoE+K?= =?us-ascii?Q?6WN2lrClBlAMLfjy2BPei2QKJKcJVJTzkgbkNb9UNHcYw+6A+1MaF/hzB6+R?= =?us-ascii?Q?hRV/+AoYeqkPzSboEO2jC5FWnIchNIUMD5rNBVo0IZcXLK/wlNrz/PVMIGJT?= =?us-ascii?Q?qP05OtErfm4FupNcEw/9s7KYdZ/0LRetivAvpbv8sEeIxR72H6rTlL0YixN3?= =?us-ascii?Q?jHf6VPZs63njUZGvy3sGVEqPfX+DXVL5sir1uZ9ZnV/JOwgrPUbtbwQx3qGJ?= =?us-ascii?Q?Aj 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: ccefe1ab-adae-4637-84e3-08d9ce698f3d X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2022 03:31:41.8759 (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: iEGgQxt3U690bu2sPtBhNxBmMfMdTFdQ66yYjelK6Nqkw/vxfM1Q/YyuJLS87oTZ8YJMzfPxuqyqsO6KF0E47g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB3858 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10215 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 adultscore=0 bulkscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201030022 X-Proofpoint-GUID: hpoOiify2tyo_r1WgFqSu8xI548rsF5H X-Proofpoint-ORIG-GUID: hpoOiify2tyo_r1WgFqSu8xI548rsF5H Received-SPF: pass client-ip=205.220.165.32; envelope-from=drew.adams@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) 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=unavailable 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:283990 Archived-At: > Sorry for I was making that conclusion based on > the wrong assumption about how buffer local > variables works. >=20 > But I think instead of testing whether > `lexical-binding' has been bound, > (if (>=3D emacs-major-version 24) > (provide 'lexical-binding)) My question has nothing to do with `provide'ing a `lexical-binding' feature. Adding such a feature is neither needed nor helpful. (And with that name it might even mislead.) > testing major version number seems to be easier since > it is unlikely someone would take an old version of > Emacs and patch for lexical binding only, or use a > version above 24 but taking out the lexical binding > support. Testing the Emacs version # is OK also, of course. But that coding difference too is irrelevant for my question/post. It's not about that, at all. And in general it's a bit better to test for a variable or function definition (`(f)boundp') than it is to test for an Emacs version. For one thing, it lets a reader of the code know specifically what's needed from that version. > And instead of doing the lexical binding support test > in every file, having the `provide' statement in one > file loaded before any other files and use `featurep' > as a universal test of that feature seems to be more > appropriate. My question is specific to a single file. It's even specific to particular parts of a file. > I apologize again for not reading your post carefully. No problem. At least you tried to help. Thx. > However, as Stefan says, what lexical-binding provides > is "nothing ground breaking", even you've already > hit a critical performance bottle neck, converting > to lexical binding would help little. I'm well aware of what it has to offer. But thx. > In my opinion, adopting lexical-binding is mainly > for making the code cleaner. Having both lexical > binding and dynamic binding in one library, seems > to be contrary to that goal. What I asked about and mentioned is not about having lexical and dynamic binding in the same library - that is, for the same Emacs version. Variable `lexical-binding' is itself not about having only lexical binding. It's simply about Emacs support for lexical binding _in addition_ to dynamic binding (what Common Lisp has offered since its outset).