1 Void Functions
Stan does not technically support functions that do not return values.
It does support two types of statements that look like functions, one
for printing and one for rejecting outputs. Documentation on these
functions is included here for completeness. The special keyword
void
is used for the return type of void functions, because they
behave like variadic functions with void return type, even though they
are special kinds of statements.
Although print
and reject
appear to have the syntax of functions,
they are actually special kinds of statements with slightly different
form and behavior than other functions. First, they are the
constructs that allow a variable number of arguments. Second, they
are the the only constructs to accept string literals (e.g., "hello world"
) as arguments. Third, they have no effect on the log density
function and operate solely through side effects.