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

Non-fixed-width init(repeating:) #45

Open
oscbyspro opened this issue Jul 31, 2023 · 3 comments
Open

Non-fixed-width init(repeating:) #45

oscbyspro opened this issue Jul 31, 2023 · 3 comments
Labels
addition oh, so shiny! maybe to do, or not to do?

Comments

@oscbyspro
Copy link
Owner

I think init(repeating:) should be moved to NBKBinaryInteger so it becomes available to IntXL, and UIntXL could reasonably trap on init(repeating: true). I suppose that adding a duplicate requirement to NBKSignedInteger is an alternative, but I don't find that as elegant.

@oscbyspro oscbyspro added addition oh, so shiny! maybe to do, or not to do? labels Jul 31, 2023
@oscbyspro oscbyspro changed the title Non-fixed-width init(repeating:)? Non-fixed-width init(repeating:) Jul 31, 2023
@oscbyspro
Copy link
Owner Author

oscbyspro commented Aug 2, 2023

The asymmetry of (#34) is an argument in favor of adding a duplicate requirement to NBKSignedInteger. Hm.

@oscbyspro oscbyspro removed the maybe to do, or not to do? label Aug 2, 2023
@oscbyspro oscbyspro added this to the v0.8.0 milestone Aug 2, 2023
@oscbyspro
Copy link
Owner Author

oscbyspro commented Aug 2, 2023

I suppose it's unclear what size this would give a manually resizable integer. Hm.

@oscbyspro oscbyspro added the maybe to do, or not to do? label Aug 2, 2023
@oscbyspro
Copy link
Owner Author

oscbyspro commented Aug 3, 2023

An alternative is committing to fixed-width by moving init(bit:) to NBKFixedWidthInteger. The rationale being that heap allocating a single bit is almost never what you intend to do.

@oscbyspro oscbyspro modified the milestones: v0.8.0, v0.9.0 Aug 5, 2023
@oscbyspro oscbyspro removed this from the v0.9.0 milestone Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition oh, so shiny! maybe to do, or not to do?
Projects
None yet
Development

No branches or pull requests

1 participant