Closed yurrriq closed 8 years ago
(defmacro doto
"Evaluate all given s-expressions and functions in order,
for their side effects, with the value of `x` as the first argument
and return `x`."
(`(,x . ,sexps)
`(let ((,'x* ,x))
,@(lists:map
(match-lambda
([`(,f . ,args)] `(,f ,'x* ,@args))
([f] `(,f ,'x*)))
sexps)
,'x*)))
This is in https://github.com/rvirding/lfe/pull/267
I've got an implementation of
doto
lying around. Should we include it?