[pro] (values) for for-effect functions

Didier Verna didier at lrde.epita.fr
Fri Dec 3 08:06:41 UTC 2010


Daniel Weinreb wrote:

> I'd like to write in our programming standards either that they should
> be used, or that they should not be used. I think it's suboptimal for
> them to be used in some places and not others, since the inconsistency
> could lead a reader of the code to draw wrong conclusions.
>
> What do people think?

  I've looked at some of my code, and it seems that the only places I
use (values) are in for-effect generic functions'methods that are
specialized to do nothing. I find it more readable than using an empty
body or just say "nil" (because even "nil" suggests it /is/ a return
value).

It seems to me that when a function or method actually /does/ something,
you can always find a return value that would be potentially meaningful
in the future, even if nobody uses it right now.

-- 
Resistance is futile. You will be jazzimilated.

Scientific site:   http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com




More information about the pro mailing list