From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Naming predicates Date: Fri, 28 Sep 2018 12:40:25 -0700 (PDT) Message-ID: References: <20180925021527.10418.61555@vcs0.savannah.gnu.org> <20180925021528.9A119204E8@vcs0.savannah.gnu.org> <87bm8lanwu.fsf@gmx.de> <87o9ck6270.fsf@gmx.de> <2cfc5ca3-d661-f431-397a-705682ab17eb@cs.ucla.edu> <877ej5ap0o.fsf@gmx.de> <3356af4b-f6f5-e353-6162-a5fa8880d223@cs.ucla.edu> <2a1f7389-0248-4920-ba11-ecc0b6aaee22@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1538163557 11195 195.159.176.226 (28 Sep 2018 19:39:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 28 Sep 2018 19:39:17 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 28 21:39:13 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g5ybX-0002lz-Mp for ged-emacs-devel@m.gmane.org; Fri, 28 Sep 2018 21:39:11 +0200 Original-Received: from localhost ([::1]:45573 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5yde-0008HR-D6 for ged-emacs-devel@m.gmane.org; Fri, 28 Sep 2018 15:41:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5ycw-0008HB-8T for emacs-devel@gnu.org; Fri, 28 Sep 2018 15:40:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5ycq-0004aK-A2 for emacs-devel@gnu.org; Fri, 28 Sep 2018 15:40:38 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:43994) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g5ycq-0004Zs-0A for emacs-devel@gnu.org; Fri, 28 Sep 2018 15:40:32 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8SJd40S072646; Fri, 28 Sep 2018 19:40:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=/xlCQu1eqqZHM8hkG640uNO/H+z2vz2IVVRobO58jxM=; b=oNGy+EKV4btvy1uy36sdUr4LcVAp6eoOilBQLGTrcpNpG6SfgqazM8rhScJ5qVoSrHv0 Ck8skeWyYlrlUJt9YJGK2L8n9fPe1hubDRupKTeqG0q2HbBwao6aqZ2NxWNeLqBCK3sv c9KC6YLw2pJ2HvAeay+NpSZ+5ftvlaCFcajukfMGNJKphg07QDPlCpYQ3LDKpO6XjHVW sWCZb1iERgkXOZJ8FoT62qDx+/tNity5DQJVLW63x2o0x436m1EH2Y/++BkTqj5UkdSf b6/5S5LMEVNfMl6ZRoIfiY2zZJci/AC7qnDDmurL8RgMS42xNAgMXLxFCnLqF2aFXhYw cA== Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2mndpq28au-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Sep 2018 19:40:28 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w8SJeRmo014982 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Sep 2018 19:40:27 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w8SJeQJh028223; Fri, 28 Sep 2018 19:40:26 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4735.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9030 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809280193 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 141.146.126.78 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230120 Archived-At: > >> If the purpose of a function is to tell you whether a certain > >> condition is true or false, give the function a name that ends in > >> 'p' (which stands for "predicate"). If the name is one word, add > >> just 'p'; if the name is multiple words, add '-p'. Examples are > >> 'framep' and 'frame-live-p'. >=20 > *Users* should never define a single-word function, since they should > use a namespace prefix. Hence "I'd say you can simply always use "-p" > when it's something you define". Users are free to do _anything_ they like. As I said, "as a user you can use whatever you want." And users who write Lisp, creating a predicate, are not necessarily writing a package or library, and they might well not want to use a "namespace prefix." And I believe (but I don't have a reference) that RMS pointed out that the single-word recommendation does not include a "namespace prefix". (Logically, it should not. IMO.) Another consideration might be a multiple-word name that is based on an existing name. It could be helpful to keep the same name as a part, instead of adding a hyphen.=20 > You don't have to follow them when you define your own function. You never have to follow them, if you're not providing code for the Emacs distribution. Does even code provided for Emacs itself _have_ to follow them? If so, clearly that "have to" has been bypassed or missed sometimes. > > indivisible-p interactive-p ring-p registerv-p > > bool-vector-subsetp coding-system-lessp default-boundp file-attributes-= lessp > > hack-one-local-variable-eval-safep ... >=20 > Yes, there are conflicting desires: when you define something that's > very much like "foop" but in the context of "strigles", the multi-word > rule suggest you name it "strigle-foo-p", but there's also an argument > to be made for "strigles-foop". Yes, that's just what I meant above. > As the author of that function you get to follow whichever of the two > you like. Personally, I think always using "-p" is a simpler rule and > is never wrong (that's the rule followed by `cl-defstruct`, > incidentally). Even using "-p" on single-word thingies is > perfectly acceptable. Acceptable does not mean conventional.