[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: canonical name ending "-p"

From: Drew Adams
Subject: RE: canonical name ending "-p"
Date: Fri, 18 Mar 2011 11:31:44 -0700

> It means predicate. Functions ending in -p return either t
> or nil, and variables ending in -p contain either t or nil.

Actually, either non-nil (true) or nil (false).

"Boolean" in Lisp can mean this or it can mean strictly `t' or `nil'.
Generally, any non-nil value is taken to mean true, but for `defcustom' the
:type `boolean' limits the value to t or nil.

Also, most people do _not_ use `-p' when naming a boolean variable.  I use it
that way quite often, but some Emacs developers frown on this use.

For user options, some people (including me) use the suffix `-flag' for a
boolean option.  I tend to use `-p' for internal variables (non-options).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]