diff --git a/doc/docs.md b/doc/docs.md index 77e0f8ce39..00ac64fd8b 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -85,8 +85,8 @@ To do so, run the command `v up`. * [Variable number of arguments](#variable-number-of-arguments) * [Anonymous & higher-order functions](#anonymous--higher-order-functions) * [Closures](#closures) -* [References](#references) * [Parameter evaluation order](#parameter-evaluation-order) +* [References](#references) * [Constants](#constants) * [Required module prefix](#required-module-prefix) * [Builtin functions](#builtin-functions) @@ -2619,6 +2619,23 @@ i = 10 print_counter() // 10 ``` +### Parameter evaluation order + +The evaluation order of the parameters of function calls is *NOT* guaranteed. +Take for example the following program: +```v +fn f(a1 int, a2 int, a3 int) { + dump(a1 + a2 + a3) +} + +fn main() { + f(dump(100), dump(200), dump(300)) +} +``` +V currently does not guarantee, that it will print 100, 200, 300 in that order. +The only guarantee is that 600 (from the body of `f`), will be printed after all of them. +That *may* change in V 1.0 . + ## References ```v @@ -2669,25 +2686,6 @@ struct Node { To dereference a reference, use the `*` operator, just like in C. -see also [Stack and Heap](#stack-and-heap). - -### Parameter evaluation order - -The evaluation order of the parameters of function calls is *NOT* guaranteed. -Take for example the following program: -```v -fn f(a1 int, a2 int, a3 int) { - dump(a1 + a2 + a3) -} - -fn main() { - f(dump(100), dump(200), dump(300)) -} -``` -V currently does not guarantee, that it will print 100, 200, 300 in that order. -The only guarantee is that 600 (from the body of `f`), will be printed after all of them. -That *may* change in V 1.0 . - ## Constants ```v