Closed loksonarius closed 3 years ago
Totally in favor of this!
Sent from my iPhone
On Aug 28, 2019, at 10:11 AM, Dan notifications@github.com wrote:
It seems like the || (failover, default) operator only works to change what parameter is passed in to an operator. This seems to be the intended behavior as described in this doc.
From initial view of the operator, I was hoping that the case would've been that it evaluates a whole new operator on failure of the left-hand expression. This is so that I could do something like this in my document:
meta: user: (( grab $USER ))
Try grabbing the $ENV var if set, otherwise prompt the user for the value
environment: (( grab $ENV || param "What environment are we testing in?" )) Is there any way we could make the || operator work on entire operator expressions instead of just parameters? That is change (or add a new operator) that accomplishes:
foo: (( operator1 "reference to operator1's parameter" || operator2 "whole other parameter for a different operator" )) instead of
foo: (( operator1 "reference to operator1's parameter" || "alternative parameter for operator1" )) I don't have time right now to work on a PR for this, but would be willing to give it a shot later if it's something that'd be wanted/accepted in the project.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Sweet. I'll add a reminder to come back to this when I finish my current work. I'm still absolutely down for anyone passing by to implement it as well if they're willing. 🙏
closing as stale
It seems like the
||
(failover, default) operator only works to change what parameter is passed in to an operator. This seems to be the intended behavior as described in this doc.From initial view of the operator, I was hoping that the case would've been that it evaluates a whole new operator on failure of the left-hand expression. This is so that I could do something like this in my document:
Is there any way we could make the
||
operator work on entire operator expressions instead of just parameters? That is change (or add a new operator) that accomplishes:instead of
I don't have time right now to work on a PR for this, but would be willing to give it a shot later if it's something that'd be wanted/accepted in the project.