unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Sean Whitton <spwhitton@spwhitton.name>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Robert Pluim <rpluim@gmail.com>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: RE: [External] : Re: master 101f3cf5b9: Add support for user edits to VC command arguments
Date: Thu, 22 Sep 2022 22:21:16 +0000	[thread overview]
Message-ID: <SJ0PR10MB54888CED38881D3C884D3552F34E9@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87edw3o0hs.fsf@melete.silentflame.com>

> I thought that in Lisp we often call boolean values predicates too,

I do.  But I think it's become verboten for Emacs.

> even though that violates the usage of 'predicate' in mathematics.

No, it doesn't, actually.  A programming "variable"
can be likened to a nullary function.  That we also
have another kind of nullary function doesn't change
this.

(And a predicate "in mathematics" is not necessarily
a function at all.  There are several (related) uses
of the term.)

> Is there some other convention for booleans like this one?

I don't think I've seen one adopted by Emacs.  But
someone will correct me...

There is the `-flag' suffix convention for user
options (not other variables), which Stefan mentioned.
RMS promotes that.  I use it, but I may be the only
one who does.  I think it's helpful to have a separate
such suffix for options, even if that one is a bit long.

The argument Stefan makes against any such convention
is reasonable.  It's definitely the case that a var
often starts out as Boolean and later allows for more
values.  Renaming isn't such a big deal for user code.
But it's a pain for vanilla Emacs code (i.e., a big
user base).

This is a real consideration, no doubt.  But hey, this
is Lisp - schema-flexible, etc.  And we have aliasing.
Que demande le peuple ?

That worry/argument, BTW, doesn't apply to local vars,
e.g., let-bound vars and function parameters.  I often
use suffix `-p' in those contexts.  It's a very short
suffix, and it makes the code/intention clearer, IMHO.



  parent reply	other threads:[~2022-09-22 22:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <166378878197.3568.7077863090259744101@vcs2.savannah.gnu.org>
     [not found] ` <20220921193303.1B687C11D81@vcs2.savannah.gnu.org>
2022-09-22  9:25   ` master 101f3cf5b9: Add support for user edits to VC command arguments Robert Pluim
2022-09-22 13:24     ` Stefan Monnier
2022-09-22 16:08       ` Sean Whitton
2022-09-22 16:55         ` Stefan Monnier
2022-09-22 21:18           ` Sean Whitton
2022-09-23  6:39             ` Juri Linkov
2022-09-22 22:21         ` Drew Adams [this message]
2022-09-22 16:06     ` Sean Whitton
2022-09-23  8:03       ` Robert Pluim
2022-09-23 16:15         ` Sean Whitton
2022-09-22 18:45   ` Stefan Monnier
2022-09-22 21:38     ` Sean Whitton
2022-09-22 22:41       ` Stefan Monnier
2022-09-23 17:56         ` Sean Whitton
2022-09-23 19:32           ` Stefan Monnier
2022-09-23 21:51             ` Sean Whitton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB54888CED38881D3C884D3552F34E9@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rpluim@gmail.com \
    --cc=spwhitton@spwhitton.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).