[pro] Style issue about predicates

Luke Crook luke at balooga.com
Fri Jan 14 20:42:17 UTC 2011


Daniel Weinreb <dlw at ...> writes:

> 
> If you have a function that is a predicate, in the sense that
> the function's contract says that its value should be interpreted
> as being either false or true, do you think it's better to code
> it so that it always returns "t" for the true case?
> 

I use '-p' and '?' depending on the function name aesthetics (generally not both 
in the same function name). These return whatever object is being tested, for 
example physics-hook-p will return a function or NIL otherwise.

How about defining defsetf for predicates?

-Luke





More information about the pro mailing list