------- Original Message -------
On Friday, September 9th, 2022 at 21:01, Marc Nieper-Wißkirchen <
xxxxxx@gmail.com> wrote:
# Abstract
Procedures that take procedures as argument, and return procedures, namely: combinators.
The procedures identify essential complexity. Their use allows keeping the code terse,
readable, and reduce the need for convenience procedures.
"Readable" is very subjective. Personally, I prefer less terse code that writes out some of the procedures in this SRFI as explicit lambda terms.
I use the word readable here to describe the value proposition: “what you will get”, the “How” in the rationale, i.e., “less fragmentation”. Yes, it is subjective, it is also different depending on people prior experience. Here, the important words are 'identify essential complexity'. That library put a name on widespread code practices [citation needed].
# Rationale
Many procedures take a procedure as argument (map, filter, fold, filter...), that leads to two situations:
- The code use a lambda to describe the needed behavior, that is a composition of existing procedures, and often enough it spans on multiple lines…
- It is argued that it is better to move the lambda into a define, which requires finding a good name, and split the action into different locations, making the code harder to read.
Who argues this regularly outside the C or Python (or [insert any insufficiently functional programming language]) community?
I read that in a Clojure guide, I can't find it at
https://guide.clojure.style/. Anyway, to keep the code readable I recommend laying out the body of a procedure following the algorithm: top-down, left-to-right, and often a lambda passed as an argument grow big and on multiple lines that it breaks the 5-ideas at most in my head, hence break the scan flow, example:
(filter (lambda (g) (or (odd? g) (complex? g) (infinite? g)) (iota 42))
Where the following is easier to scan, hence read:
(filter (disjoin odd? complex? infinite?) (iota 42))