Skip to content

Commit 0b0567a

Browse files
authored
Merge pull request #391 from gyorokpeter/pattern2
add example of null pattern in function signature
2 parents 435e946 + 4b76ab2 commit 0b0567a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/basics/pattern.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ q)a
6565

6666
The null pattern matches anything. It cannot be used as the main pattern in an assignment, but it can appear as a component of more complex patterns by elision.
6767

68+
A function can indicate unused parameters with null patterns.
69+
70+
```q
71+
q)f:{[x;]x}
72+
q)f[3;4]
73+
3
74+
```
75+
6876
### Constant value
6977

7078
The simplest pattern is a constant (atom or list). If the assigned value exactly matches (see [~](../ref/match.md)), the assignment does nothing. If the values don't match, a `'match` error is thrown.

0 commit comments

Comments
 (0)