You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/reference-manual/user-functions.Rmd
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,8 @@ data {
20
20
21
21
Function definitions and declarations may appear in any order, subject
22
22
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.
25
25
26
26
27
27
## Function Names
@@ -182,7 +182,7 @@ number generators are available; see the rest of this section for details.
182
182
183
183
Functions that call random number generating functions in their bodies
184
184
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
186
186
error.
187
187
188
188
Like other random number generating functions, user-defined functions
@@ -197,7 +197,7 @@ a function elsewhere results in a compile-time error.
197
197
Functions that include sampling statements or log probability
198
198
increment statements must have a name that ends in `_lp`.
199
199
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.
201
201
202
202
Like the target log density increment statement and sampling
203
203
statements, user-defined functions with names that end in `_lp`
@@ -251,7 +251,7 @@ the log of the density or mass function it defines.
251
251
Within function definition bodies, the parameters may be used like any
252
252
other variable. But the parameters are constant in the sense that
253
253
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
255
255
constant throughout the function body. Attempting to assign a value
256
256
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++.]
257
257
@@ -367,7 +367,7 @@ without bodies. For example,
367
367
real unit_normal_lpdf(real y);
368
368
```
369
369
370
-
declares a function named `unit_normal_log` that consumes a
370
+
declares a function named `unit_normal_lpdf` that consumes a
371
371
single real-valued input and produces a real-valued output. A
372
372
function definition with a body simultaneously declares and defines
0 commit comments