9 ms·
> 'first' and 'rest' for 'car' and 'cdr' are obviously better, because they say what's going on I sometimes use cons cells for binary trees - first and rest ar
by sedachv 9y ago
> 'first' and 'rest' for 'car' and 'cdr' are obviously better, because they say what's going on
I sometimes use cons cells for binary trees - first and rest are misleading in that case. I very often use cons cells to define things - the car is some object and the cdr is some property or definition that applies to the object. first and rest are misleading for that use case.
What you are proposing is to use domain-specific names for operations on an abstract data structure. Any names with pre-existing meaning will become misleading as soon as the data structure is applied to a different application. Coming up with new terminology to unambiguously refer to new technical concepts is not a "problem," it is a means of effective communication.