I've been torn on what a more "natural" name for POINTFREE might be, and what possible symbol might be used for it.
This is the "specialization by example" or "tacit programming" construct (rather impressively written in a small bit of usermode code, I might add):
>> apde: pointfree [append _ [d e]]
>> apde [a b c]
== [a b c [d e]]
>> apabc: pointfree [append [a b c]]
>> apabc [d e]
== [a b c [d e]]
>> apabc [f g]
== [a b c [d e] [f g]]
One idea was to use the operator <-
, as a sort of complement to lambda.
bump-up: <- [add 1]
bump-down: <- [subtract _ 1]
Though it's kind of dumb, because it winds up looking like information is flowing in the wrong direction:
x: [1 2 3 4 5 6]
all [
5 = until/predicate [take x] <- [greater? _ 4]
x = [6]
]
Also it doesn't seem to couple with the code. I had the idea of making it variadic, so you would put the operator into a group:
bump-up: (<- add 1)
bump-down: (<- subtract _ 1)
This coheres slightly better to me, e.g. when using as a predicate:
x: [1 2 3 4 5 6]
all [
5 = until/predicate [take x] (<- greater? _ 4)
x = [6]
]
But it's less efficient (has to make a block to pass to POINTFREE*) .
The idea of fusing it as a special mode of the lambda operator when nothing is on the left is possible:
x: [1 2 3 4 5 6]
all [
5 = until/predicate [take x] (-> greater? _ 4)
x = [6]
]
But it's a lot of voodoo. I am almost liking the word pointfree better than the symbol here.
x: [1 2 3 4 5 6]
all [
5 = until/predicate [take x] pointfree [greater? _ 4]
x = [6]
]
What looks good here? If we're going to use a name like POINTFREE we might as well use TACIT because it's shorter.
tacit - adj. - understood or implied without being stated.
x: [1 2 3 4 5 6]
all [
5 = until/predicate [take x] tacit [greater? _ 4]
x = [6]
]