Open hostilefork opened 6 years ago
I think you meant postfix: enfix :prefix
...
I don't see why it has to be necessary to force postfix functions to TAKE (the output of) their left hand arguments ... if they don't, it will simply be discarded, like it would have been in the non-postfix case anyway.
A change was made which allows a function with a variadic first parameter to be enfixed. But because the Rebol evaluator proceeds from left to right--discarding intermediate results along the way--it is not possible to gather more than one "variadic" parameter from the left. e.g.:
By the time the lookahead is done to notice that left-variadic-op is interested in its left argument, the "3" result from
1 + 2
has been discarded.So mechanically, the left hand side can only be a source of 0 or 1 arguments. This was made to appear as a variadic feed which can provide at most one value.
But the general gist of variadic parameters is that they are "held in waiting" until they are TAKE'd. Yet the left hand stream...already processed...doesn't have this property. e.g.:
With
do [prefix f]
you will getAnd with
do [f postfix]
you will getIn fact, it doesn't matter if you TAKE at all... f gets run regardless.
Various forms of clarification could be used here...for instance, marking frames that have left variadic input, and making sure that by the time they complete they have TAKE'd the input.
Previously I wrote on this topic: