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

Document spread dot and safe dot #5519

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions docs/reference/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -767,10 +767,12 @@ myList[0]

### Property expression

A property expression consists of an *object expression* and a *property*, separated by a dot:
A property expression consists of an *object expression* and a *property*, separated by a *dot*, *spread dot*, or *safe dot*:

```nextflow
file.text
myFile.text // dot
myFiles*.text // spread dot: myFiles.collect { myFile -> myFile.text }
myFile?.text // safe dot: myFile != null ? myFile.text : null
```

The property must be an identifier or string literal.
Expand All @@ -783,10 +785,12 @@ A function call consists of a name and argument list:
printf('Hello %s!\n', 'World')
```

A *method call* consists of an *object expression* and a function call separated by a dot:
A *method call* consists of an *object expression* and a function call separated by a *dot*, *spread dot*, or *safe dot*:

```nextflow
myList.size()
myFile.getText() // dot
myFiles*.getText() // spread dot: myFiles.collect { myFile -> myFile.getText() }
myFile?.getText() // safe dot: myFile != null ? myFile.getText() : null
```

The argument list may contain any number of *positional arguments* and *named arguments*:
Expand Down
Loading