carpentries-incubator / workflows-nextflow

Workflow management with Nextflow and nf-core
https://carpentries-incubator.github.io/workflows-nextflow/
Other
18 stars 29 forks source link

Nextflow review @bobturneruk ep11, Ternary operators #142

Open ggrimes opened 2 months ago

ggrimes commented 2 months ago

Ternary operators should be explained more fully if the term is to be used.

ggrimes commented 2 months ago

I mention Ternary operators mention in the episode 11 as below.

This code uses the ternary operator that is a shortcut expression that is equivalent to an if/else branch assigning some value to a variable.

If expression is true? "set value to a" : "else set value to b"

would you like an example added ? e.g.

penv = task.cpus > 1 ? "sharedmem" : null