From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: declare function/macro private Date: Mon, 07 Jun 2021 03:37:03 +0200 Message-ID: References: <0278C47F-42CE-45C4-B789-83C57DF1A191@bydasein.com> <87v96qrguz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8920"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: "Paul W. Rankin" , Stefan Monnier , Tassilo Horn To: "Paul W. Rankin" via "Emacs development discussions." Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 07 03:37:59 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 1lq4DG-0001yn-0J for ged-emacs-devel@m.gmane-mx.org; Mon, 07 Jun 2021 03:37:59 +0200 Original-Received: from localhost ([::1]:35808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lq4DF-0006rD-11 for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 21:37:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lq4CV-00060W-4S for emacs-devel@gnu.org; Sun, 06 Jun 2021 21:37:11 -0400 Original-Received: from mail-oln040092067020.outbound.protection.outlook.com ([40.92.67.20]:21984 helo=EUR02-AM5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lq4CS-0002jh-LR; Sun, 06 Jun 2021 21:37:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FUt/oR9/9YLoyBIva0yuKSFMV9mtztUOgU6tAqpfhnrhag4x6XusL81kl2uRn6o3smJTa3lh3u1Z3A4rq83PpGdGPaWxZrrBsR5Vsp5yO9kE4dFbkbNjzCnV6yZYK0xgGk8t5ojNFEmKmPh3Vdb54ZYzYi+iRWxf16gSDNqCIVJQjB8e9gesu+dGKxjAJUew3Sp8RHeX2d9klAUa8+WqBavucmL9RJQhIGTIGhemZljLVFX7QmqD/A3tTpJ4ApDrFKWOxrZw67jJTn3xE9aeYlpcadjRgJNvtP1Aj8k/N4yt9TBQTuuQlmcvNt0y/skusczLyj+zVKgmcRwd/AIMvQ== 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-SenderADCheck; bh=t6t6O1w31aR5jd8mIABV4sOs0Wx1fSscS15mJ6XTvqc=; b=W4IidD44b02a+PjYxCYnmE2cfU36Bz79ERQnXsBb6GxMmaEw3LjMW6UwZh/a7cWEATK1OHEfEH85ZmYi1vfLceQfi4uMufwkqNqoA/fS2MnS3PAmV4bjMIqd08/gOgYtzXr+m2TA+QwZnHZ7Uvc4sS02O4S/aAb0RfnutkBI9CeUyfEPBKVRiETiQFt7ctcB38Z/eGJCO25tPWFABIZRHoNg10OngbbEP92hUJwo6H0oXYAK8xwh0mBaVbRTHISjc3kf2kc2uaVnPPjMU4wiwebSJeTUZI/gIZ0QrKSb0is1RyOHgkCPEm7xAC67qULhWO/0J0DCSYNtWydG1xyctw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t6t6O1w31aR5jd8mIABV4sOs0Wx1fSscS15mJ6XTvqc=; b=H2jyKaSWwYcsTiqjxFYjnSdHRZpX/jt/6bEXH9QOt4ua19BjqOhHuVORjuYw/hefyAKPOTFYdq9icltngCaU33JwsG+vGOzOy/V1jNcajtg8RIuRSqYstljhjkpdgOu+CX2TOtQTEaC7cEHstwJYzJKdGg4m7opyLOsre44x9/nTIcxJjcsguUpqvmip9AkTI5/A66aHGWcF964VdRD9FneipHU9zWepOkl8Nm9MAXZe5W9WaL1Qu15neIIhFhFJPucO0rTTbepMA01S6Uu9PptXd2qsAwdg5MeTp1UKRqSsLwKzxAZFiLWYd3WJn7+OzzSVCq/adyV7PAA1OJrFkw== Original-Received: from HE1EUR02FT040.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1d::4d) by HE1EUR02HT022.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1d::460) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.18; Mon, 7 Jun 2021 01:37:04 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e1d::42) by HE1EUR02FT040.mail.protection.outlook.com (2a01:111:e400:7e1d::348) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.18 via Frontend Transport; Mon, 7 Jun 2021 01:37:04 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:6A7347CA6FC93FAB9A455274C0F9D52BB3E7BC3C8460AF9494CDF8DAE27CF9A1; UpperCasedChecksum:95F8C330D1F6849FA47E8EB75882D608414B9A5BC75EE737E09210D920F9E10A; SizeAsReceived:7720; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::d1c1:2a0d:3b2b:4591]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::d1c1:2a0d:3b2b:4591%7]) with mapi id 15.20.4195.030; Mon, 7 Jun 2021 01:37:04 +0000 In-Reply-To: (Paul W. Rankin's message of "Mon, 7 Jun 2021 10:51:12 +1000") X-TMN: [KtCW6G+LJODPlgc1fgxJBAcOnEJ8ctjP] X-ClientProxiedBy: AM5PR0301CA0021.eurprd03.prod.outlook.com (2603:10a6:206:14::34) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87pmwysbeo.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AM5PR0301CA0021.eurprd03.prod.outlook.com (2603:10a6:206:14::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.22 via Frontend Transport; Mon, 7 Jun 2021 01:37:04 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: a0899372-0b24-4e3e-39d5-08d92954c102 X-MS-TrafficTypeDiagnostic: HE1EUR02HT022: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GSsfOYtJjhnhTA4nMeCna85Y0FYryh5Xo/4hTeODGagZ2YSG6lJX5yiytO3vsqELcu59sQfqIMvBvXc25Un4V8Ss6MFdi9/I62ad+50SWud0ZJP5WStw0EcG1yWyuNs0/mLcOJ+w5HiURNCVy4nJXU7PhIOSnFigxbfcIkyWhvjQd80JRS8lnCnRTfADKeETweAyeQZHQVAs2BrZ7klTR944dytBOnlGtZxGPe7sgxhK/8/HnduMmjU4kYZ+evMkDHI1c7Dqqdj9Fb0LVC3oAe34Gj2dGRpCq5UN0beOHLCCUuhn69iXIcBRuhCCeo0KNxzbxKNjdR+YzcX5Lhg1S4dIq50cXuMCZtMVYbnyXSFHSFgQaJ8qdlRuOv6xnR9KSmBAbiw+zgdQnNtr3XBLiw== X-MS-Exchange-AntiSpam-MessageData: xAh7KegmSlxseApV/iMqNGk1GjpmW7ikFnfZ63SvH/W6QcrAPfbwd/GYxeN0SQtShDWaZLSpGinG4CD6t0XjupGjAYp69A1NtdjfpDFPp2Q4WsP+cJ24Wt6FA7C0Gw18EMQnJadgGorVlYMUS1/PbQ== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0899372-0b24-4e3e-39d5-08d92954c102 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2021 01:37:04.5320 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR02FT040.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR02HT022 Received-SPF: pass client-ip=40.92.67.20; envelope-from=arthur.miller@live.com; helo=EUR02-AM5-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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.23 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:270511 Archived-At: "Paul W. Rankin" via "Emacs development discussions." writes: >> On 7 Jun 2021, at 6:12 am, Stefan Monnier wrote: >> >> Tassilo Horn [2021-06-06 20:12:49] wrote: >>> Stefan Monnier writes: >>>> I think the "--" convention actually includes an extra information >>>> compared to yours which could be useful here: we could warn for uses >>>> of "foo--" if and only if the use appears in something whose name >>>> doesn't start with "foo-". >>>> >>>> IOW, use the string before the "--" as the definition of the "library" >>>> (so that would support cases where a library is spread over several >>>> files, as well as the case where a single file contains "internal >>>> libraries"). >>> >>> If my package was structured like >>> >>> foo.el >>> foo-search.el >>> foo-parse.el >>> >>> I'd find it quite natural to name a private function in foo-search.el >>> `foo-search--do-stuff'. Of course, it's ok if my `foo-base-do-stuff' >>> function from foo.el calls it but it would trigger a warning with your >>> approach because the "library" would be foo-search, no? >> >> Indeed, the idea is that you'd have to use foo--search-do-stuff for >> those functions which are private to your foo package but not to >> foo-search.el, whereas you'd use foo-search--do-stuff for functions >> which are not only private to your package but even private to >> foo-search.el. > > If there is a lake with a bunch of alligators in it, it would be a good thing to put up a sign that says "Danger: No swimming, Alligators". > > Such a sign's sole purpose is to provide warning to people considering swimming in the alligator-infested lake, it does not actually prevent them from being eaten by alligators should they ignore the warning. > > What I'm suggesting is to put up the sign, not to figure out a way to prevent alligators from eating swimmers who ignore the sign. Isn't a '--' that sign?