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

ra_machine: Allow the version/0 callback to return 0 #399

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

dumbbell
Copy link
Member

@dumbbell dumbbell commented Oct 19, 2023

Why

0 is now a valid value the version/0 callback can return. It has always been a valid value, but the callback couldn't return that.

This allows a Ra machine module to explicitly set the initial version, even though it is the default implicit one.

How

The assert_integer/1 function, renamed to assert_version/1 in the progress, now accepts 0 as a valid value.

The version/0 callback spec is improved to return the version() type.

The is_versioned/1 helper behavior changes: an unversioned Ra machine is a module which doesn't export the version/0 callback.

@dumbbell dumbbell force-pushed the improve-version-callback-spec branch 2 times, most recently from 656a5ee to 1c9155e Compare October 31, 2023 15:09
@dumbbell dumbbell changed the title ra_machine: Make the version/0 callback return a version() type ra_machine: Allow the version/0 callback to return 0 Oct 31, 2023
@dumbbell dumbbell self-assigned this Oct 31, 2023
@dumbbell dumbbell requested a review from kjnilsson October 31, 2023 15:47
[Why]
0 is now a valid value the `version/0` callback can return. It has
always been a valid value, but the callback couldn't return that.

This allows a Ra machine module to explicitly set the initial version,
even though it is the default implicit one.

[How]
The `assert_integer/1` function, renamed to `assert_version/1` in the
progress, now accepts 0 as a valid value.

The `version/0` callback spec is improved to return the `version()`
type.

The `is_versioned/1` helper behavior changes: an unversioned Ra machine
is a module which doesn't export the `version/0` callback.
@the-mikedavis the-mikedavis force-pushed the improve-version-callback-spec branch from 1c9155e to 72a69a4 Compare October 31, 2023 21:05
@dumbbell dumbbell marked this pull request as ready for review November 2, 2023 09:58
@michaelklishin michaelklishin added this to the 2.8.0 milestone Nov 2, 2023
@kjnilsson kjnilsson merged commit b85ca7c into main Dec 20, 2023
6 checks passed
@the-mikedavis the-mikedavis deleted the improve-version-callback-spec branch December 22, 2023 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants