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

[gh-1117] add math modules. #2259

Conversation

ghpZ54K8ZRwU62zGVSePPs97yAv9swuAY0mVDR4
Copy link
Collaborator

Summary

Add move math modules u8, u16, u32, u64, u128, u256.

Copy link

vercel bot commented Jul 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rooch-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2024 2:29pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Visit Preview Jul 24, 2024 2:29pm


/// This module holds shared implementation of macros used in `std`
module std::macros {
public macro fun num_max($x: _, $y: _): _ {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do macros support arguments of arbitrary types?

Choose a reason for hiding this comment

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

See the above doc.

Type inference holes _ on type annotations

With type directed programming, often you need to annotate a variable declaration or provide type arguments. But, sometimes you really only need to annotate on specific type, but the other types can be inferred. _ will be added to allow that type to still be inferred, even when other parts of the type are annotated. For example

dynamic_field::borrow_mut<address, Coin>(&mut id, owner)

could be rewritten as

dynamic_field::borrow_mut<_, Coin>(&mut id, owner)

where the _ would be inferred as address

@jolestar
Copy link
Contributor

Rooch move do not support macros yet.

@ghpZ54K8ZRwU62zGVSePPs97yAv9swuAY0mVDR4
Copy link
Collaborator Author

Rooch move do not support macros yet.

Is there a way to support the 2024 macros version or we back to the one without macros?

@jolestar
Copy link
Contributor

Rooch move do not support macros yet.

Is there a way to support the 2024 macros version or we back to the one without macros?

Back to the one without macros.

@ghpZ54K8ZRwU62zGVSePPs97yAv9swuAY0mVDR4
Copy link
Collaborator Author

Rooch move do not support macros yet.

Is there a way to support the 2024 macros version or we back to the one without macros?

Back to the one without macros.

I have submitted the ones without macros.

Copy link
Contributor

@jolestar jolestar left a comment

Choose a reason for hiding this comment

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

Needs some testcase.

@ghpZ54K8ZRwU62zGVSePPs97yAv9swuAY0mVDR4
Copy link
Collaborator Author

Needs some testcase.

Added.

@ghpZ54K8ZRwU62zGVSePPs97yAv9swuAY0mVDR4 ghpZ54K8ZRwU62zGVSePPs97yAv9swuAY0mVDR4 merged commit cc7e560 into rooch-network:main Jul 24, 2024
7 checks passed
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.

[MoveosStd] Math modules
3 participants