@@ -250,16 +250,15 @@ function submodel(prefix_expr, expr, ctx=esc(:__context__))
250250end
251251
252252"""
253- @returned_quantities [prefix=...] model
253+ @returned_quantities model
254254
255255Run `model` nested inside of another model and return the return-values of the `model`.
256256
257- Valid expressions for `prefix=...` are:
258- - `prefix=false`: no prefix is used. This is the default.
259- - `prefix=expression`: results in the prefix `Symbol(expression)`.
260-
261- Prefixing makes it possible to run the same model multiple times while keeping track of
262- all random variables correctly, i.e. without name clashes.
257+ !!! warning
258+ It's generally recommended to use [`prefix(::Model, x)`](@ref) or
259+ [`@prefix(model, prefix_expr)`](@ref) in combination with `@returned_quantities`
260+ to ensure that the variables in `model` are unique and do not clash with other variables in the
261+ parent model or in other submodels.
263262
264263# Examples
265264
@@ -308,8 +307,8 @@ julia> @model function demo1(x)
308307 end;
309308
310309julia> @model function demo2(x, y, z)
311- a = @returned_quantities prefix="sub1" demo1(x)
312- b = @returned_quantities prefix="sub2" demo1(y)
310+ a = @returned_quantities prefix( demo1(x), Val{:sub1}() )
311+ b = @returned_quantities prefix( demo1(y), Val{:sub2}() )
313312 return z ~ Uniform(-a, b)
314313 end;
315314```
0 commit comments