[pro] (values) for for-effect functions
Peter Herth
herth at peter-herth.de
Fri Dec 3 10:22:47 UTC 2010
On Fri, Dec 3, 2010 at 12:30 AM, David Owen <dsowen at fugue88.ws> wrote:
> On the other hand, I agree with Peter that it can be somewhat ugly.
> Maybe some alternatives, based on (values)?
>
> (defun f ()
> (for-effect
> (setq *foo* 'bar)))
>
Actually your example hints to a case where I *do* want a for-effect
function to return a value, because setq does - which is also a
strictly for-effect function. Similar, I like methods to return the
object they were called on in a Smalltalk-style, if there is nothing
better to return. Only when there is absolutely nothing useful to
return, I would consider something like (values)
Peter
More information about the pro
mailing list