by anamexis · 2w ago · 0 comments
Maybe not precisely the same from a technical point of view but is it just pendantry to argue against someone referring to it as a fluent interface? Happy to learn and to be corrected if required.
To suggest the pipeline proposal must not be referred to as a "fluent interface" would seem to me to be arguing semantics, ignoring the point behind the words, or the facts that they can have implied meanings or subtle changes over time.
Note that the language with the best support for this concept is Perl, with its $_ variable.
|> docker.listContainers() filter(x => x.name == “something”) first getNetwork getIpAddress toString ping
(ignore that some of these should be chained and some should be arguments, I haven’t read the proposal fully)
They’re doubly nice in Clojure because of the lazy evaluation. You can map a pipeline over a list and it will evaluate one at a time rather than pre-evaluating and allocating memory for the whole thing.
Which true is not per se fluent interfaces, but it reads similarly.
And "fluent" -- as the name suggests -- has a lot to do with how it reads, left-to-right with no intermediate variables.