Skip to content

Conversation

claymcleod
Copy link
Collaborator

@claymcleod claymcleod commented Jan 26, 2025

This change proposes extending conditional statements to include else if and else clauses.

These types of clauses have been proposed many times on Slack and more formally in #268 and #697. Overall, the feedback seems positive, though concerns have been raised as to whether the cost of added complexity is worth it (see #697 for more details). I have made my case at the end of #697 that I feel it's actually removing mental burden/complexity to add these clauses into the language.

TODO:

  • Clarify that braces can be used in ternary expressions.
  • Covers both expressions and workflow statements.
  • Update logic to derive non-optional and optionals based on @cjllanwarne's comment.

Closes #268.

Before submitting this PR, please make sure:

  • You have added a few sentences describing the PR here.
  • You have added yourself or the appropriate individual as the assignee.
  • You have updated the README.md or other documentation to account for these changes (when appropriate).
  • You have updated the CHANGELOG.md describing the change and linking back to your pull request.
  • You have read and agree to the CONTRIBUTING.md document.
  • You have added or updated relevant example WDL tests to the specification.
    • See the guide for more details.

@claymcleod claymcleod self-assigned this Jan 26, 2025
@claymcleod claymcleod changed the base branch from wdl-1.2 to wdl-1.3 January 26, 2025 14:47
@claymcleod claymcleod added the Z-specification-change (Metadata) An issue or PR related to a specification change. label Jan 26, 2025
@claymcleod claymcleod force-pushed the feat/else-if branch 2 times, most recently from 70ec19d to 4cd725b Compare January 26, 2025 15:00
@a-frantz
Copy link

I feel it's actually removing mental burden/complexity to add these clauses into the language.

I agree with this, though I'll admit my programming background bias. I find it more complicated to create two unconnected if clauses with negated expressions than it would be to simply have an else (or else if) clause.

@geoffjentry said:

A question I'd have is: if one were to survey the world's breadth of public WDLs, how often do you see the above?

And I can point to at least one instance of this pattern in our workflows repository - https://github.com/stjudecloud/workflows/blob/main/workflows/qc/quality-check-standard.wdl#L351-L386

@claymcleod claymcleod added K-feature (Kind) A new feature request (for issues) or implementation (for PRs).. S05-in-progress (State) A task that is in progress. labels Feb 26, 2025
@peterhuene peterhuene added this to the 1.3 milestone Aug 28, 2025
@claymcleod
Copy link
Collaborator Author

@peterhuene and @cjllanwarne, there still may be some polishing needed on the text, but let me know how this reads generally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
K-feature (Kind) A new feature request (for issues) or implementation (for PRs).. S05-in-progress (State) A task that is in progress. Z-specification-change (Metadata) An issue or PR related to a specification change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants