From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Omar Polo Newsgroups: gmane.emacs.devel Subject: Re: declare function/macro private Date: Sun, 06 Jun 2021 09:09:42 +0200 Message-ID: <87o8cjcvux.fsf@omarpolo.com> References: <0278C47F-42CE-45C4-B789-83C57DF1A191@bydasein.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10408"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.15; emacs 28.0.50 Cc: emacs-devel@gnu.org To: "Paul W. Rankin" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 06 09:11:00 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 1lpmw0-0002UA-DM for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 09:11:00 +0200 Original-Received: from localhost ([::1]:47618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpmvz-0007pZ-En for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 03:10:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpmv0-00071C-E5 for emacs-devel@gnu.org; Sun, 06 Jun 2021 03:09:58 -0400 Original-Received: from mail.omarpolo.com ([144.91.116.244]:56460) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpmux-0002Uq-BR for emacs-devel@gnu.org; Sun, 06 Jun 2021 03:09:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omarpolo.com; s=20200327; t=1622963383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2wincPDU6R6ttsPIK7+0zK/+rIJL4HiewGwC/JK5BR4=; b=HWzbOkvUnsYY1S2mQQYfXMk0IdOYcvGS9CUaVEN5YqgZrIogv438GxdVALO+bqvScI2uzB d9qPKSujaRZ+OQdUbpDIMSt6bx+co8hmoTJFns6hxCeO/Gjz+N8r4HroJHjS7gXh7lxTdh +yyZ/8feFoArI+zoelhwQ4TLAYhXloc= Original-Received: from localhost (host-79-44-237-248.retail.telecomitalia.it [79.44.237.248]) by mail.omarpolo.com (OpenSMTPD) with ESMTPSA id 94cbc089 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 6 Jun 2021 09:09:43 +0200 (CEST) Original-Received: from venera (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id fa10b3b3; Sun, 6 Jun 2021 09:09:42 +0200 (CEST) In-reply-to: <0278C47F-42CE-45C4-B789-83C57DF1A191@bydasein.com> Received-SPF: pass client-ip=144.91.116.244; envelope-from=op@omarpolo.com; helo=mail.omarpolo.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, 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.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:270465 Archived-At: Paul W. Rankin via Emacs development discussions. writes: > Given we have a function/macro declare interactive-only property, would it be worthwhile to consider a `private' property? > > Of course there's already the convention of prefix--my-private-function, but my thinking here is that a program could declare a function/macro as private, then the compiler could signal a warning/error if that function appeared in a library outside the library it was defined and declared private. > > e.g. in foo.el: > > (defun foo-private () > (declare (private "use `foo-public' instead.")) > ...) > > (provide 'foo) > > ..in bar.el: > > (defun bar-function () > (foo-private)) > > Compiling bar.el would signal a warning/error with hint to use `foo-public' instead. but if foo.el and bar.el are part of the same package, wouldn't be fine for bar.el to use internal functions from bar.el?