Good question. This is an illustration of how perverse actions often have consequences that appear perverse. Indeed, it is a case of a double perversity.
The first perversity is attaching a child's 1 end to the 1 end of its parent. Don't do that unless you want to generate confusion (in yourself and others; the computer is never confused). It is the root node of the root section that dictates the direction of increasing arc distance: arc distance increases with increasing distance from the root node of the root section. That's why arc distance in s2 increases from its 1 end to its 0 end. And it's also why define_shape() created pt3d data points such that x3d increases from the 1 end to the 0 end of s2.
The second perversity is trying to make sense of a confusing outcome by taking a statement out of context. The statement quoted from the NEURON Book was written in the context of a model whose topology was set up in such a way as to avoid generating confusion, and it is true in the context of such a model.
For a statement that is true under all circumstances, I quote the documentation of arc3d in the Programmer's Reference:
SYNTAX
arc3d(i)
DESCRIPTION
This is the arc length position of the ith point in the 3d list. arc3d(n3d()-1) == L
"Well, doesn't that mean that the statement in the NEURON Book is misleading?"
No. The particular model that is considered on that page has only one section, and in the context of that model, the statement in the book is simple, clear, and correct. It would be an intrusive diversion, more likely to baffle than inform, to insert a discussion full of caveats that pertain to models with multiple sections.
So--
To avoid confusion about arc length and related issues, follow these simple rules:
1. Always connect the 0 end of a child section to its parent.
2. NEVER connect the 1 end of a child section to a parent.