First, you can simplify the C++ to one block, if your comment is believed.
So, let's simplify in C++ first, shall we?
if(some_condition_satisfied(g)) {
a = eval(g); // never returns zero, right?
// so we roll the next if block into this one
do_something();
}
In clojure, I'd try
(if (some_condition_satisfied g)
(let [a (eval g)]
(do_something)))
Notice I'm setting a a
but not using it. Is that what you meant? Otherwise, pass it into do_something
or change the if condition
(if (and (some_condition_satisfied g) (not= 0 (eval g)))
(do_something))
This would match the C++ code for
if ( some_condition_satisfied(g) && 0 != eval(g) ){
do_something();
}
Also, my clojure is rusty, but I'm pretty sure I checked the syntax.