Should we support ((f))
syntax for higher order functions?
#145
Labels
RFC
Comments from the community are solicited
((f))
syntax for higher order functions?
#145
The docs say this:
Now that we no longer use Racket's
curry
to implement this (we use a simplelambda
instead), there would no longer be "unexpected behavior" here (IIRC the unexpected behavior was that a curried function applied to zero arguments expects to be applied at least one more time to pre-supplied arguments before actually evaluating to a result on the third invocation). Our partial application syntax matches(name arg ...+)
. We could change this to(name arg ...)
and that would then expect an expression like(e)
, wheree
is any Racket expression, to evaluate to a partial application of a flow arising frome
to no arguments. So although it could be a more convenient syntax for using higher-order functions where it's conceivable one might prefer((f))
to(esc (f))
, it would effectively be an alternative way to say(esc e)
always, for any Racket expressione
producing a flow, and that could potentially be confusing. Technically, a partial application form expands to a use of a blanket template (i.e.(e)
becomes(e __
), whereas anesc
form compiles directly to the escaped expression. These may always be equivalent in practice, though. Or it may be that this would suffer from the issue identified later in that section of the docs:Should we allow this?
The text was updated successfully, but these errors were encountered: