Question mark in variable and function names

Dave Pawson davep at dpawson.co.uk
Wed Oct 6 13:32:26 EDT 2004


On Wed, 2004-10-06 at 18:11, Alex Martelli wrote:
> Andr? N?ss <andre.naess at gmail.com> wrote:
> 
> > One thing I liked about Lisp was the ability to use the question mark
> > (and the exclamation mark) in function names. I found this
> > particularily useful when checking boolean properties of a object like
> > for example myObj.isContextSet. It just feels so much more natural to
> > write myObj.contextSet?
> 
> Even though I haven't used Lisp extensively, I agree with you.  Naming
> all predicates with a trailing question mark,

Makes for a nice readability feature, though lisp does have lots of 
inbuilt function, with functionp being the predicate form.
oddp
evenp
exp ... oops :-)

Yes, I like the Scheme idea of a ? suffix being the predicate :-)


-- 
Regards DaveP.
XSLT&Docbook  FAQ
http://www.dpawson.co.uk/xsl





More information about the Python-list mailing list