Skip to content

Unify initBigInt for SomeIntegers#142

Open
konsumlamm wants to merge 1 commit intonim-lang:masterfrom
konsumlamm:initBigInt
Open

Unify initBigInt for SomeIntegers#142
konsumlamm wants to merge 1 commit intonim-lang:masterfrom
konsumlamm:initBigInt

Conversation

@konsumlamm
Copy link
Copy Markdown
Contributor

Unify the various initBigInt versions that convert an integer to a BigInt into one func.

@pietroppeter
Copy link
Copy Markdown
Contributor

FWIW I do prefer the original version and I am not able to see advantages of the unification.

@konsumlamm
Copy link
Copy Markdown
Contributor Author

Before, initBigInt for int and uint were templates, so it wasn't possible to e.g. pass them to higher order functions. Additionally, now you can specify the integer type in all cases. I think it's more consistent to have one function for all integer types than have some with a generic argument and some without (and some templates). This also reduced the number of cases (there is no extra case needed for int and uint anymore).

@pietroppeter
Copy link
Copy Markdown
Contributor

Ok, thanks for the explanation

@dlesnoff
Copy link
Copy Markdown
Contributor

dlesnoff commented Dec 30, 2023

I had the same impression as @pietroppeter and I also noticed that it greatly simplifies the documentation with just what we want in the public API.
Are you just sure that it was not purposefully chosen to use templates there in the first place?
EDIT: I performed a Git blame, and I think that it is nice to remove these.

Copy link
Copy Markdown
Contributor

@dlesnoff dlesnoff left a comment

Choose a reason for hiding this comment

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

Thanks.

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

Successfully merging this pull request may close these issues.

3 participants