all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Pascal J. Bourguignon" <pjb@informatimago.com>
To: help-gnu-emacs@gnu.org
Subject: Re: canonical name  ending "-p"
Date: Fri, 18 Mar 2011 18:56:37 +0100	[thread overview]
Message-ID: <878vwcia7e.fsf@kuiper.lan.informatimago.com> (raw)
In-Reply-To: mailman.8.1300470004.7441.help-gnu-emacs@gnu.org

ken <gebser@mousecar.com> writes:

> Lots of things in elisp end in "-p"... is there some particular meaning
> in this?

They are predicates.  Predicates are functions that usually take a
single argument, and return a boolean attribute of this argument.

In some cases, it may be a generalized boolean, with an interesting
value for true.

For example, (digit-char-p ?9) --> 9 which is true, but more
interesting, since it's also the numeric value of the digit character.


Notice also, as this example shows, that some classical predicates don't
have the p or -p suffix.  For example: atom

   (atom x) == (not (consp x))



A single word predicate would end with p, a multiword one with -p:

   integerp
   upper-case-p 


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


       reply	other threads:[~2011-03-18 17:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.8.1300470004.7441.help-gnu-emacs@gnu.org>
2011-03-18 17:56 ` Pascal J. Bourguignon [this message]
2011-03-18 20:36 ` canonical name ending "-p" Evans Winner
2011-03-19  4:32   ` rusi
2011-03-18 17:39 ken
2011-03-18 18:11 ` Allan Gottlieb
2011-03-18 18:18 ` Perry Smith
2011-03-18 18:31   ` Drew Adams
2011-03-18 18:20 ` Tom Rauchenwald
2011-03-18 18:31   ` Drew Adams
     [not found] ` <mailman.12.1300472466.7441.help-gnu-emacs@gnu.org>
2011-03-19  1:52   ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=878vwcia7e.fsf@kuiper.lan.informatimago.com \
    --to=pjb@informatimago.com \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.