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

move is_valid() logic to constructor or factory function? #4

Open
dckc opened this issue Nov 3, 2016 · 0 comments
Open

move is_valid() logic to constructor or factory function? #4

dckc opened this issue Nov 3, 2016 · 0 comments

Comments

@dckc
Copy link

dckc commented Nov 3, 2016

Why have methods such as CryptoSecretBoxNonce.is_valid()? Why not forbid creation of an invalid CryptoSecretBoxNonce by using a private constructor and a factory function that can fail?

This is perhaps mostly a question of what idomatic pony should look like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant