-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to best short-circuit entire template evaluation #500
Comments
In general, the ability to write guard clauses can make it easier to reason over a function (lowercase 'f'). 👍🏻 It's effectively a kind of precondition which alleviates the reader from being concerned about that condition for the rest of the execution. Turning towards implementation concerns... More context:
Options:
Concerns:
|
that's still one of the options. we can rewrite ast to support return at top level. question is it a good idea? |
I'm on the fence, ATM. On the one hand — as I noted above — guard clauses can made a larger script much more easier to reason about. On the other hand, this mechanism can be used to terminate execution anywhere in the script. Imagine there's a |
im also on the conservative side for such change, since it may come with its own set of sharp edges. |
possible workaround, from conv w dimitry, using a
.lib.yaml
....Describe the problem/challenge you have
Right now, we have to sometimes nest 1000s of lines of yaml in a
block, which can be hard to reason about (i.e. what is this
#@end
referring to?)...https://github.com/vmware-tanzu/tanzu-framework/blob/main/pkg/v1/providers/infrastructure-vsphere/v0.7.10/ytt/overlay.yaml
Describe the solution you'd like
Something like
so that we can short circuit (or not) the processing of a file in some way.
The text was updated successfully, but these errors were encountered: