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

Add optional typenum-macro that provides tyint and tyuint (resolves #131) #136

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

jerry73204
Copy link
Contributor

This PR provides tyint and tyuint convenient macros to convert integer literals into typenum types, signed and unsigned versions respectively.

It adds an optional feature macros to let users optionally include these macros.

Copy link
Owner

@paholg paholg left a comment

Choose a reason for hiding this comment

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

Hey, sorry I have been unresponsive. I did not have the mental energy to look at this repo for a while there.


This is really cool! It would be neat to combine it with the op! macro, but I'm happy to leave that to a later time.

My only concern is that I've never managed a multi-crate repo before. Will crates.io allow publishing a crate with a local optional dependency like this? And, if so, if one depends on typenum from crates.io, will that dependency work?

Or do we need to publish the macro crate separately, and then rely on its crates.io version, to make this happy with the Crates ecosystem?

@jerry73204 jerry73204 force-pushed the value-to-type-macro branch 2 times, most recently from 35fa60d to 7236859 Compare July 24, 2020 22:27
Both tyint tyuint are convenient macros to convert integer
literals into typenum types.
@jerry73204
Copy link
Contributor Author

I made some changes to get ready for merge.

  • rebase to master
  • doc comments and examples
  • remove cargo feature gate

The splitting of multi-crate is due to the limitation of procedure-macro. You'll have to publish both of the crates to crates.io. Make sure uploading the typenum-macro before typenum and the version matches. The path is fine here. You can see an existing example in tch-rs (link).

Base automatically changed from master to main March 12, 2021 03:55
@paholg
Copy link
Owner

paholg commented Mar 12, 2021

Thanks again for this and sorry for the delay. I'm going to merge it, and try to see if I can incorporate the op macro.

Edit: Because it makes typenum unpublishable for now, I'm going to merge it to a new branch.

@paholg paholg changed the base branch from main to proc_macro March 12, 2021 08:47
@paholg paholg merged commit 76a3d36 into paholg:proc_macro Mar 12, 2021
@Soya-Onishi
Copy link

Soya-Onishi commented Dec 5, 2022

Is it still not ready for merge to main branch?
I don't know what is the barrier, but I tried this and there seems to be no problems.

If there are some problems prevent from merge, please tell me. I try to fix them.

@paholg
Copy link
Owner

paholg commented Dec 5, 2022

The only issue is that the typenum-macro crate is not published to crates.io.

@paholg
Copy link
Owner

paholg commented Dec 5, 2022

Created an issue to track it: #188

@Soya-Onishi
Copy link

Thanks for your reply!
Probably, there is no room to contribute for this though, I'm looking forward this release!

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