help-gnu-emacs
[Top][All Lists]
Advanced

[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:37 -0700

> > Lots of things in elisp end in "-p"... is there some 
> > particular meaning in this?
> 
> I was told it means "predicate" long ago by the guy who 
> introduced me to lisp and emacs.

Yes.  It is an old Lisp idiom, not just Emacs Lisp.

> In Ruby, they use a '?' so they have 'blank?'
> -- but '?' isn't a legal character in a 
> symbol so they append "p" for predicate.

This part is incorrect.  `?' is perfectly legal in a Lisp symbol.
Put your cursor on a `?' char in Emacs Lisp mode and do `C-u C-x ='.  You will
see this: "syntax: _    which means: symbol".  Then try it:

(defun foo? () (forward-char 1))

[Unfortunately, vanilla Emacs completion treats `?' specially, so you'll need to
quote it using `C-q ?' if you want to use `C-h f' to get help on `foo?': `C-h
foo C-q ?']

> I'm curious if I have this right or not...

Yes, except for `?'.




reply via email to

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