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

Suggest using the ~ modifier in the version pragma #2614

Closed
2 tasks
axic opened this issue Jul 21, 2017 · 5 comments
Closed
2 tasks

Suggest using the ~ modifier in the version pragma #2614

axic opened this issue Jul 21, 2017 · 5 comments
Assignees

Comments

@axic
Copy link
Member

axic commented Jul 21, 2017

  • examples
  • style guide
@veox
Copy link
Contributor

veox commented Jul 21, 2017

From: #2608 (comment)

@chriseth
Copy link
Contributor

Can you explain the benefit of ~ over ^? They behave identical in the examples given in the linked comment.

@axic
Copy link
Member Author

axic commented Jul 26, 2017

I think I've confused the two, we should be fine.

After major 0 it will be different though:

~1.2.3 := >=1.2.3-0 <1.3.0-0 “Reasonably close to 1.2.3”.
^1.2.3 := >=1.2.3-0 <2.0.0-0 “Compatible with 1.2.3”.

@chriseth
Copy link
Contributor

So can this be closed?

@veox
Copy link
Contributor

veox commented Jul 27, 2017

@chriseth Guess so.

Must say, I, too, have misunderstood the difference between tilde and caret ranges (for ref in npm's doc: ~ and ^).

For extra safety in the future (after v1.0.0), it might be prudent to recommend (in the docs) ~M.m.p (that is, tilde and all three of major-minor-patch), in the off-chance that a backward-incompatible change makes it into a "minor" update by accident. People who don't think this can happen can use ~M.m instead.

That said, if this recommendation change would be made prior to v1.0.0, it should be safe to start recommending now, since ~0.5.0 and ^0.5.0 result in the same range: >=0.5.0 <0.6.0 (according to npm's docs - haven't looked at solc's code at all on this one).

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

No branches or pull requests

4 participants