Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
BioTurboNick authored Apr 26, 2024
1 parent ac10228 commit 2a9a008
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/check

`@default_checked` and `@default_unchecked` create shadow copies of the `+`, `-`, `*`, `^`, and `abs` functions that redirect to overflow-checked
or overflow-permissive operations, respectively, within the module it was executed in. All non-integer arguments are passed through to their
respective Base methods.
respective Base methods. **Important:** The first usage this macro must occur earlier than the first usage of the affected Base functions.

The expression-level `@checked` and `@unchecked` rewrite instances of `+`, `-`, `*`, `^`, and `abs` functions, to functions specific to the
checked or permissive operation, and thus are not affected by switching the default. Symbols for the functions will also be replaced, to support
Expand All @@ -18,6 +18,8 @@ context and vice versa.

```julia
using OverflowContexts
@default_unchecked # Julia default, but need to place first so later usages will work

x = typemax(Int) # 9223372036854775807
x + 1 # -9223372036854775808

Expand Down

4 comments on commit 2a9a008

@BioTurboNick
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/105690

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.3 -m "<description of version>" 2a9a0081829b2a4cf96e5b584f63ff1510ab6fcd
git push origin v0.2.3

@BioTurboNick
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

Minor changes

  • Added validation to ensure default_ methods don't run if any of the Base symbols have been resolved
  • Adjusted to account for Julia 1.11 now including checked_pow

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/105690

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.3 -m "<description of version>" 2a9a0081829b2a4cf96e5b584f63ff1510ab6fcd
git push origin v0.2.3

Please sign in to comment.