Comment by kbp
8 years ago
> The 90% case here is "second", "third", etc.
In addition to first and rest, Lisp has provided second, third, fourth, etc since the 70s, as well as the more general nth/elt which just takes the index as an argument.
> there are other naming conventions that would be more readable. You could use "h" and "t" for head and tail, or "l" and "r" for left and right
Why would you bother replacing names with 60 years of precedent with h and t so that instead of cdaddr you could write thtt? I think cdaddr nonsense is illegible and very bad style, but I don't see how someone could seriously suggest writing thtt as a good solution to that readability problem. The real solution is to use named accessors instead of ad-hoc pointer chains.
No comments yet
Contribute on Hacker News ↗