Open njtierney opened 2 months ago
e.g., Use method dispatch inside of calculate to avoid
calculate
if (is.greta_mcmc_list(values)) { result <- calculate_greta_mcmc_list( target = target, values = values, nsim = nsim, tf_float = tf_float, trace_batch_size = trace_batch_size ) } else { result <- calculate_list( target = target, values = values, nsim = nsim, tf_float = tf_float, env = parent.frame() ) }
Thanks @maelle for the suggestion
my source = https://speakerdeck.com/jennybc/code-smells-and-feels?slide=55 :smile_cat:
e.g., Use method dispatch inside of
calculate
to avoidThanks @maelle for the suggestion