Skip to content

Commit 94c68e8

Browse files
authored
Enhance RAP15 with boolean predicate shorthand
Add short-hand application for boolean predicate functions.
1 parent b93026f commit 94c68e8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • courses/RascalAmendmentProposals/RAP15

courses/RascalAmendmentProposals/RAP15/RAP15.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ syntax Pattern = Pattern pattern “==” Expression value`
2828
And the short-hand expansion is:
2929
`p == v` expands to `tmp:p if tmp == v`
3030

31+
We also allow for short-hand application of boolean predicate functions:
32+
```
33+
int E if isOdd
34+
```
35+
36+
This translates to:
37+
```
38+
int E if isOdd(E)
39+
```
40+
3141
The `when` notation and semantics could be completely removed in time.
3242

3343
## Motivation

0 commit comments

Comments
 (0)