[pro] Style issue about predicates

Ben Hyde bhyde at pobox.com
Fri Jan 14 17:05:56 UTC 2011


On Jan 14, 2011, at 11:42 AM, Daniel Weinreb wrote:
> 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 am distracted by the need to write:

   (defun truthy (x) (not (not x)))

or if you's is the kind of organization that builds a development v.s.  
a production version...

   (defmacro truthy (x) #+dev `(not (not ,x)) #-dev `,x)

It would be nice to have a code base that is more truthy.






More information about the pro mailing list