it's more idiomatic to use *when* rather than *if* for cases where you
won't be considering the false path.
(when (= x y) z)
cond is used more as a multi-if with a drop out at the end (usually using
:else which because it's a keyword is truthy when evaluated).
On Wednesday, 19 February 2014
I originally posted this in Stack
Overflowhttp://stackoverflow.com/questions/19505334/clojure-algo-monad-strange-m-plus-behaviour-with-parser-m-why-is-second-m-plus,
but realised I might get more response from the google group. Apologies for
duplication.
I'm seeing some issues using a parser
, 2013 at 4:23 AM, Mark Fisher
mark.j...@gmail.comjavascript:
wrote:
I originally posted this in Stack Overflow, but realised I might get
more
response from the google group. Apologies for duplication.
I'm seeing some issues using a parser monad created from the state monad
, then, given that mplus is not a macro, both
arguments will be evaluated, and both prints will happen.
Since the state modifications aren't both happening, I assume that the
actual computation returned---the domonad block---is being correctly
treated.
On Tue, Oct 22, 2013 at 4:23 AM, Mark Fisher