3 ms·
Are you kidding? cdar would be the second element, cddar the third, and so on. And they're harder to misread on a scan through the code. As a general rule, I
by hinkley 10y ago
Are you kidding? cdar would be the second element, cddar the third, and so on. And they're harder to misread on a scan through the code.
As a general rule, I assume that I read most lines of the code not when I'm writing it, nor fixing a bug, but while I'm trying to locate a bug of unknown location. The complexity or trickiness of a function that you are actively modifying can be pretty high and you'll still grasp it. But a function not even involved with a problem needs to be even more legible if you don't want to repeatedly waste time contemplating it to determine if you should move on.
- junke 10y agoKeep calm and read the Common Lisp specification (http://clhs.lisp.se/Body/f_firstc.htm http://clhs.lisp.se/Body/f_firstc.htm) There are first, etc... accessors (other Lisps might define them too, it is so easy to implement). People are encouraged to use them, especially for lists, and are even encouraged to not use them but prefer objects with named slots. The general advice is to reserve C..R functions for trees, but this is actually rarely needed, especially when using pattern matching.