Navigation Menu

Skip to content
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

else? #268

Open
SooLee opened this issue Nov 19, 2018 · 2 comments
Open

else? #268

SooLee opened this issue Nov 19, 2018 · 2 comments

Comments

@SooLee
Copy link

SooLee commented Nov 19, 2018

I noticed 1) works but not 2). Can we have else for conditional blocks (not just one-liners)?

1)

workflow merge {
    Array[File] smallfiles = []
    if(length(smallfiles)>2) {
        call paste {input: files = smallfiles}
    }
    if(length(smallfiles)<=2) {
        call cat {input: files = smallfiles}
    }
}

2)

workflow merge {
    Array[File] smallfiles = []
    if(length(smallfiles)>2) {
        call paste {input: files = smallfiles}
    }
    else {
        call cat {input: files = smallfiles}
    }
}
ERROR: Unexpected symbol (line 6, col 5) when parsing '_gen10'.
Expected rbrace, got else.
@rhpvorderman
Copy link
Contributor

if .. then .. else
is a very well-known paradigm in programming. Also it is human readable. So this not violate the goals of WDL and I am very much in favour of adding this.

@illusional
Copy link
Contributor

It would be good to add specifics for if, else if and else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants