Open pdeffebach opened 3 years ago
I think this is a good idea. I wonder if it needs to be a little more obvious than just @exit
but maybe @EXIT
or something so that looking through a chain with an early break one can immediately spot that it has been interrupted for debugging purposes. I suppose such a feature might be programmatically used for flow control. Something like ((sum(_.A) > x) && @exit)
.
Wouldn't @break
be a better name for such an action? @exit
seems to be a bit too much in the context of similarly named functions in julia.
One thing that might be nice is to add a flag for exiting the
@chain
block.One workflow I use at the REPL is to have a big block that I add to a bunch. But if I wrote a bug that is an an intermediate location, I want to be able to go to that spot.
here is a big block
What if I think I created
diff_from_action
wrong? To get to the the chain at exactly that place, I would have to delete or comment out a lot of stuff. Or add anend
and face a bunch of errors.But if I could just add an
@exit
flag right after thediff_from_action
command, I could just forget about all the stuff after.This would solve one thing that made me hesitant about
@chain
earlier. One benefit of the%>%
in dplyr was that it was easy to break out of the chain and return what you wanted.