|
|
|
|
|
by aleph_minus_one
283 days ago
|
|
> But the second interpretation only makes sense if the last item somehow deserves special treatment (over, say, the second-to-last item). There do exist reasons why this can make sense: - In an Algebraic Data Type implementation of a non-empty list, the last symbol is a different type constructor than the one to append an item to the front of an existing non-empty list (similarly how for an Algebraic Data Type implementation of an arbitrary list, the type constructor for an initial empty list is "special"). - In a single-linked list implementation, sometimes (depending on the implementation) the terminal element of the list is handled differently. --- By the way: at work, because adding parameters at the beginning of a (parameter) list of a function is "special" (because in the code for many functions the first parameters serve a very special purpose), but adding some additional parameter at the end is not, we commonly use parameter lists formatted like 'foo'
, 'bar1'
, 'bar2'
, 'blub'
|
|