Sławomir Grochowski <[email protected]> writes:
> You pointed out that the original pointer-walking version is harder to
> read and maintain. Earl had the opposite reaction and preferred the
> patch version over the `cl-loop' variant.
Ha-ha! Every engineer has their views on maintainability. :)
[Feel free to ignore mine, given it is all so subjective!]
> (setq triplets (cdr triplets))
> (setq specs (cdr specs))
> (setq w (cdr w)))))
This is a lock-step mutation, a perfect use for a single `setq`:
(setq triplets (cdr triplets)
specs (cdr specs)
w (cdr w))
Or, how about we use `pop` to communicate intent?
(pop triplets)
(pop specs)
(pop w)
Speaking of intent, I am not loving the cryptic name `w`.
Option 1: Be explicit about the intent.
(pop remaining-triplets)
(pop remaining-specs)
(pop remaining-widths)
Option 2: Shadow in the lexical scope.
(let ((...
widths widths))
...
(pop triplets)
(pop specs)
(pop widths))
Great work!
Rudy
--
"The power of mathematics rests on its evasion of all unnecessary
thought."
--- Ernst Mach, 1838-1916
Rudolf Adamkovič <[email protected]> [he/him]
http://adamkovic.org