Re:The Background for CAR and CDR
by bsder on Monday December 27, 2021 @05:09PM
(#29707414)
> Clojure did away with `car` and `cdr`, but it also did away with the ability to make plain pairs from `cons`.
And it also means that more things than lists can be accessed as sequences using iterators.
The whole "Have to recurse the entire chain to figure out if something is terminated with nil/() and therefore a list" is part of the reason why everybody bangs on about tail recursion instead of just writing an imperative loop.
And it also means that more things than lists can be accessed as sequences using iterators.
The whole "Have to recurse the entire chain to figure out if something is terminated with nil/() and therefore a list" is part of the reason why everybody bangs on about tail recursion instead of just writing an imperative loop.