Skip to content

Commit

Permalink
Clarify use of push macro in the presence of another push symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
markspanbroek committed Apr 26, 2021
1 parent d9f268d commit ff4f810
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ requires "upraises >= 0.1.0 & < 0.2.0"
Now you can use `upraises` instead of `raises`:

```nim
import upraises
proc example {.upraises: [].} =
# not allowed to raise any errors
```
Expand All @@ -89,7 +91,13 @@ proc example2 =
{.pop.}
```

Note the slightly different syntax for `push`; this is required because Nim currently [doesn't support][3] pushing custom pragmas.
Note the slightly different syntax for `push`; this is required because Nim
currently [doesn't support][3] pushing custom pragmas. When there's already a
`push` proc in scope, you may need to use the fully qualified name:

```nim
upraises.push: {.upraises: [].}
```

[1]: https://nim-lang.org/docs/manual.html#effect-system-exception-tracking
[2]: https://nim-lang.org/docs/manual.html#pragmas-push-and-pop-pragmas
Expand Down

0 comments on commit ff4f810

Please sign in to comment.