Abstract, and Rationale Amirouche (09 Sep 2022 18:55 UTC)
Re: Abstract, and Rationale Marc Nieper-Wißkirchen (09 Sep 2022 19:02 UTC)
Re: Abstract, and Rationale Amirouche (09 Sep 2022 19:35 UTC)
Re: Abstract, and Rationale Marc Nieper-Wißkirchen (09 Sep 2022 19:51 UTC)
Re: Abstract, and Rationale John Cowan (09 Sep 2022 21:59 UTC)
Re: Abstract, and Rationale Marc Nieper-Wißkirchen (10 Sep 2022 07:03 UTC)
Re: Abstract, and Rationale Amirouche (10 Sep 2022 08:46 UTC)
Re: Abstract, and Rationale John Cowan (10 Sep 2022 10:41 UTC)

Abstract, and Rationale Amirouche 09 Sep 2022 18:55 UTC

# 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.

# 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.

Those composition procedures, called combinators that were identified by the Scheme, and Common Lisp communities, allow making existing libraries more versatile, and future code more readable, keeping the code dense, by reducing fragmentation, and still readable.

# Notation

Many of these procedures are documented in the style of SRFI 219. Rather than showing only how the procedures themselves are invoked, it also shows how the returned procedures would be invoked. This is done to make the descriptions easier to understand. For example, if complement were documented in the standard style, the description would say "Returns a procedure which, when applied to an argument, returns #t when proc would return #f when applied to the same argument, and #f otherwise", which is more convoluted and harder to understand. However, this is merely a documentation style; it would be pointless to actually invoke these procedures in this fashion.

# Acknowledgements

CL, and chicken library authors ?

ref: https://srfi.schemers.org/srfi-235/srfi-235.html

Amirouche Amazigh BOUBEKKI ~ https://hyper.dev