Skip to content

Commit f4d4fbf

Browse files
committed
nicer code
1 parent d017e4b commit f4d4fbf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/pobserve_macro.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ function process_tilde_statements(expr::Expr)
6464
# TODO: We should probably perform some checks to make sure that this
6565
# indeed was meant to be an observe statement.
6666
@gensym left
67-
e = [
68-
:($left = $(esc(lhs))),
69-
:($loglike += $(Distributions.logpdf)($(esc(rhs)), $left)),
70-
]
71-
is_last && push!(e, :(($left, $loglike)))
72-
e
67+
e = quote
68+
$left = $(esc(lhs))
69+
$loglike += $(Distributions.logpdf)($(esc(rhs)), $left)
70+
end
71+
is_last && push!(e.args, :(($left, $loglike)))
72+
e.args
7373
elseif @capture(stmt, lhs_ .~ rhs_)
7474
@gensym val
7575
e = [

0 commit comments

Comments
 (0)