Skip to content

Commit 8476db1

Browse files
authored
Merge pull request #131 from stan-dev/bugfix/updates-and-typos
Small updates to the text and typos
2 parents 4760764 + 09fd61e commit 8476db1

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/reference-manual/blocks.Rmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ block. Most functions can be used in any block and applied to a
8282
mixture of parameters and data (including constants or program
8383
literals).
8484

85-
Random-number-generating functions are restricted to the generated
86-
quantities block; such functions are suffixed with `_rng`.
85+
Random-number-generating functions are restricted to transformed data
86+
and generated quantities blocks, and within user-defined functions
87+
ending in `_rng`; such functions are suffixed with `_rng`.
8788
Log-probability modifying functions to blocks where the log
8889
probability accumulator is in scope (transformed parameters and
8990
model); such functions are suffixed with `_lp`.

src/reference-manual/user-functions.Rmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ data {
2020

2121
Function definitions and declarations may appear in any order, subject
2222
to the condition that a function must be declared before it is used.
23-
Forward declarations are allowed in order to support recursive
24-
functions.
23+
[Forward declarations](#forward-declarations.section) are allowed in
24+
order to support recursive functions.
2525

2626

2727
## Function Names
@@ -182,7 +182,7 @@ number generators are available; see the rest of this section for details.
182182

183183
Functions that call random number generating functions in their bodies
184184
must have a name that ends in `_rng`; attempts to use
185-
random-number generators in other functions leads to a compile-time
185+
random-number generators in other functions lead to a compile-time
186186
error.
187187

188188
Like other random number generating functions, user-defined functions
@@ -197,7 +197,7 @@ a function elsewhere results in a compile-time error.
197197
Functions that include sampling statements or log probability
198198
increment statements must have a name that ends in `_lp`.
199199
Attempts to use sampling statements or increment log probability
200-
statements in other functions leads to a compile-time error.
200+
statements in other functions lead to a compile-time error.
201201

202202
Like the target log density increment statement and sampling
203203
statements, user-defined functions with names that end in `_lp`
@@ -251,7 +251,7 @@ the log of the density or mass function it defines.
251251
Within function definition bodies, the parameters may be used like any
252252
other variable. But the parameters are constant in the sense that
253253
they can't be assigned to (i.e., can't appear on the left side of an
254-
assignment (`=`) statement)<. In other words, their value remains
254+
assignment (`=`) statement). In other words, their value remains
255255
constant throughout the function body. Attempting to assign a value
256256
to a function parameter value will raise a compile-time error.^[Despite being declared constant and appearing to have a pass-by-value syntax in Stan, the implementation of the language passes function arguments by constant reference in C++.]
257257

@@ -367,7 +367,7 @@ without bodies. For example,
367367
real unit_normal_lpdf(real y);
368368
```
369369

370-
declares a function named `unit_normal_log` that consumes a
370+
declares a function named `unit_normal_lpdf` that consumes a
371371
single real-valued input and produces a real-valued output. A
372372
function definition with a body simultaneously declares and defines
373373
the named function, as in

0 commit comments

Comments
 (0)