Closed sebffischer closed 9 months ago
That is a neat idea, but probably not that easy, since a %>>% b %>>% c
first calls the second operator, which sees c
as a single value and a %>>% b
as composite. We could avoid cloning c
but would still need to clone a %>>% b
-- linear speedup for a problem with quadratic complexity, could very well not be worth it. We could try to parse the whole chain of %>>%
s and somehow see if the values are bound to anything.
This whole thing might also get difficult when there are POs with hyperparameters that the user would expected to be cloned.
Although the
>>!
operator exists, I think even for%>>%
some perf improvements could be made.Oftentimes we have something like
I think that
%>>%
should substitute its arguments and check whether the expressions are symbols or calls. If they are calls, we don't have to clone them anyway, because they don't have a binding to a name yet.