Say I have a Groovy function in a Nextflow script:
def foo() {
def x = [1, 2]
def inc = x.each{val -> val + 1}
return inc
}
def bar() {
def y = [1, 2]
def dec = y.each{val -> val - 1}
return dec
}
workflow wf {
main:
foo()
bar()
}
workflow {
wf()
wf()
}
Are the “val” variables as defined in the x.each and y.each closures in global scope, such that I potentially have to worry about them conflicting in this script?