Closed moodymudskipper closed 4 years ago
pipeR uses ?
in a clever way, but it's limited to printing.
I was hesitant to use ?
after using and abusing it in doubt and tb though.
Also ?
looks like a question, and if I want to plot or save, it s not really a question anymore
--
has precedence issues though, so we d need to deparse and create an overhead, or to make sure we respect that precedence.
~~
is safe in that regard, but looks a bit scarier for some reason.
went with ~~
, assignment ops are given special treatment to deal with precedence. It looks good with syntax highlighting.
~~
is not supported in %..%
, not sure if it should
Note that {expr; .}
works perfectly fine for most side effects, (not assignments except <<-
).
So I'm not even sure if we should bother, assigning mid way through a pipe is not great practice, and if it's in interractive use <<-
would work fine.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
A consequence of the implementation of https://github.com/moodymudskipper/nakedpipe/issues/2 is that we can use magrittr's
%T>%
if we need to.Maybe we can do better though.
side_effect(input, expr)
that would return its input((expr))
syntax~ expr
syntax as there's never any reason to pipe to formula (it uses NSE so it'd be. ~ expr
all the time)~~ expr
syntax to make it clear that it's not a regular formula.-- expr
is nice tooThe first idea is probably the wisest one, let's not inject too much weirdness.
... I think I really like the last one though....