From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Paul W. Rankin" via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: declare function/macro private Date: Mon, 7 Jun 2021 10:51:12 +1000 Message-ID: References: <0278C47F-42CE-45C4-B789-83C57DF1A191@bydasein.com> <87v96qrguz.fsf@gnu.org> Reply-To: "Paul W. Rankin" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) 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="39346"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Tassilo Horn , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 07 03:16:47 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 1lq3sk-0009w1-H8 for ged-emacs-devel@m.gmane-mx.org; Mon, 07 Jun 2021 03:16:47 +0200 Original-Received: from localhost ([::1]:54238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lq3sj-0006KN-I9 for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 21:16:45 -0400 Original-Received: from [2001:470:142:3::10] (port=39434 helo=eggs.gnu.org) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lq3XS-0003Ct-O8 for emacs-devel@gnu.org; Sun, 06 Jun 2021 20:54:49 -0400 Original-Received: from [34.202.193.197] (port=47004 helo=sendmail.purelymail.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lq3WC-0001oI-Ts for emacs-devel@gnu.org; Sun, 06 Jun 2021 20:54:20 -0400 DKIM-Signature: a=rsa-sha256; b=VOm1HpIJWa+EVqWpfNXfi8KZwA/dcfpYogTVEdqSbK+hj8MC7xBYrHEMtCRub0BVSYEzqga9875G2fQGPLq9AnJ2O0ameam6xw3R3jNWxiO/yE1F48qUzzBabhe4Bw7oE8uogWrFyogrF1qrQCD6PMzChqtvsY9vpS/9hpeVaYHoL5Y9SF7IwDJtwAHDA9zPSIWR2xkT/gW2EiQ28JbJZPFLiaLlc9oCipt2igaBWVxIFNtEE/FMw7wfgcDBkrMUDxO1cKMz4r7YE7zzhD/1SRhcw6Zq+XfGdsV5VOZWsmkMUWioTfDGZCy9az1hjBdPkh174VAaKTGVra6Pyldxww==; s=purelymail3; d=bydasein.com; v=1; bh=h8w/e5py4+N94A5Jc21xPmGGKl05crLE4y1aP27N3N8=; h=Received:From:To; DKIM-Signature: a=rsa-sha256; b=fJ9uEtGdY58bg5xUdTYdsxfCe/+sw+I6Yeri9VDgQSvFZyiIJeP5pVIE8lF5EsY4zSnA5gUS5sa2I0MXiPoJcvU5NnqZ6oo7ijeoezEhEPxREbGzT6gc5azTeb09RdBoaXcJRwU4IVJewZ1wOGk/jwBzx1bAHk/NINBd5vT4uBQWyMNGWpAd9F5y6cbFFq5b8CBC5cJMC9Yb//xNhZav3SjUeDS7x4xKECnSpm56ZJ1Zn732/3xU+Ymj6zoLPRutbdV4jBks0nxrp+XZWcQft88rqj7yUPd+a4FhORm05SZuOr6inl0o+inJIshZRQ2lLGbUyf3HTM0aukQPbsWtvw==; s=purelymail3; d=purelymail.com; v=1; bh=h8w/e5py4+N94A5Jc21xPmGGKl05crLE4y1aP27N3N8=; h=Feedback-ID:Received:From:To; Feedback-ID: 791:353:null:purelymail X-Pm-Original-To: emacs-devel@gnu.org Original-Received: by ip-172-30-0-124.ec2.internal (JAMES SMTP Server ) with ESMTPA ID 1396041604; Mon, 07 Jun 2021 00:51:17 +0000 (UTC) In-Reply-To: X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Host-Lookup-Failed: Reverse DNS lookup failed for 34.202.193.197 (deferred) Received-SPF: pass client-ip=34.202.193.197; envelope-from=pwr@bydasein.com; helo=sendmail.purelymail.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RDNS_NONE=0.793, T_SPF_HELO_TEMPERROR=0.01, T_SPF_TEMPERROR=0.01 autolearn=no 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:270506 Archived-At: > On 7 Jun 2021, at 6:12 am, Stefan Monnier = wrote: >=20 > 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-". >>>=20 >>> 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"). >>=20 >> If my package was structured like >>=20 >> foo.el >> foo-search.el >> foo-parse.el >>=20 >> 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? >=20 > 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.=