Well, writing books in a foreign language is not easy...
You may have noted that this remark from chapter 2 is still not very nice
Order of procedures
It is important to note that the order of procedures and procedure calls
matters.
When calling a procedure, it must be defined above the call site like in
the example
above. This will likely be changed in a future version of Nim.
So I tried for fun to rewrite it. I also mention a proc forward declaration --
I can not remember if you mention it at all:
Order of procedure definitions and invocations
Before a procedure can be called, the compiler has to be aware of it. That
means that
it has to be defined in advance -- at a position in the source file above
the first use, or in an already imported module.
When it is necessary to call a procedure before it can be defined, you may
use
a forward declaration: You specify only the procedure header (without the
equal
sign and the procedure body) before the first use of the procedure, and
give the
full definition at a later location.
This restriction and the need for forward declarations may be relaxed in a
future version of Nim.