
Beman Dawes wrote:
Beman Dawes wrote:
[snip]
That leaves leaf(). tail() is arguably slightly better, but not by a lot. Other possibilities:
leaf() // cryptic tail() // slightly better right() // cryptic rightmost() // better rightmost_name() // very explicit, but longish
In functional programming you often build a list by appending one element at a time. The word head is then used to refer to the last added element, and tail to the rest of the list. This suggests that the leaf is the head, not the tail. Since different people have different intuition about what is the head and what is the tail, I think the terms head and tail should not be used in this context. Here are two other possible alternatives to leaf: name() own_name() --Johan