Document implicit return values from procedures (#15738)

This commit is contained in:
Xavier Noria
2020-10-27 07:27:02 +01:00
committed by GitHub
parent 3bdc000521
commit 25955440df

View File

@@ -641,6 +641,16 @@ initialised with the type's default value. Note that referential data types will
be ``nil`` at the start of the procedure, and thus may require manual
initialisation.
A procedure that does not have any ``return`` statement and does not use the
special ``result`` variable returns the value of its last expression. For example,
this procedure
.. code-block:: nim
:test: "nim c $1"
proc helloWorld(): string =
"Hello, World!"
returns the string "Hello, World!".
Parameters
----------