-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Allow underscore characters in numeric literals #2995
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
Comments
This comment was originally written by [email protected] There is issue #2873 for adding binary literals. When I was playing with their implementation in the VM, I also decided to implement this idea sometime in the future. I didn't yet get to it, but I'd also love to see this in Dart. |
Removed Type-Defect label. |
I guess we aren't going to implement every known feature in every language. This one doesn't seem to carry its weight. Added WontFix label. |
New commits include: ``` git log --format="%C(auto) %h %s" 00c00e8adf9706bebe8f94483b7663c5f36f59d2..def32ceb1d660552eaec24839d377199aea5a569 def32ceb Revert "Revert "Use the frontend server to compile pub executables (#2968)" (#3006)" (#3008) 0dc7e50c Make `.gitignore` and `.pubignore` case-insensitive on Windows / MacOS (#3009) e89d4ab8 Generate GNU-style long file names in tar archives (#3005) d2ad13d0 Revert "Use the frontend server to compile pub executables (#2968)" (#3006) 492b15ba New binstubs for global activate using `dart pub` (#3002) e02f23bb fix grammer in .gitignore error message (#2995) e01e3a41 Use the frontend server to compile pub executables (#2968) 647989c6 Use RetryClient from package:http/retry.dart (#2980) ``` Change-Id: I9a0b5fb2b5616a5a0eaa16f3a90205bb1bb1fc8f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200878 Auto-Submit: Jonas Jensen <[email protected]> Commit-Queue: Alexander Thomas <[email protected]> Reviewed-by: Alexander Thomas <[email protected]>
This reverts commit 5c9e37f. Reason for revert: flutter builds on golem somehow broke. Original change's description: > Bump pub. > > New commits include: > ``` > git log --format="%C(auto) %h %s" 00c00e8adf9706bebe8f94483b7663c5f36f59d2..def32ceb1d660552eaec24839d377199aea5a569 > def32ceb Revert "Revert "Use the frontend server to compile pub executables (#2968)" (#3006)" (#3008) > 0dc7e50c Make `.gitignore` and `.pubignore` case-insensitive on Windows / MacOS (#3009) > e89d4ab8 Generate GNU-style long file names in tar archives (#3005) > d2ad13d0 Revert "Use the frontend server to compile pub executables (#2968)" (#3006) > 492b15ba New binstubs for global activate using `dart pub` (#3002) > e02f23bb fix grammer in .gitignore error message (#2995) > e01e3a41 Use the frontend server to compile pub executables (#2968) > 647989c6 Use RetryClient from package:http/retry.dart (#2980) > ``` > > Change-Id: I9a0b5fb2b5616a5a0eaa16f3a90205bb1bb1fc8f > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200878 > Auto-Submit: Jonas Jensen <[email protected]> > Commit-Queue: Alexander Thomas <[email protected]> > Reviewed-by: Alexander Thomas <[email protected]> [email protected],[email protected] Change-Id: I635e1c2db8ae965881359d4969cbd506348b0ed0 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201000 Reviewed-by: Jonas Jensen <[email protected]> Commit-Queue: Jonas Jensen <[email protected]>
This is a reland of 5c9e37f Following update of `DEPS` in `flutter/engine`: flutter/engine#26395 New commits include: ``` git log --format="%C(auto) %h %s" 00c00e8adf9706bebe8f94483b7663c5f36f59d2..def32ceb1d660552eaec24839d377199aea5a569 def32ceb Revert "Revert "Use the frontend server to compile pub executables (#2968)" (#3006)" (#3008) 0dc7e50c Make `.gitignore` and `.pubignore` case-insensitive on Windows / MacOS (#3009) e89d4ab8 Generate GNU-style long file names in tar archives (#3005) d2ad13d0 Revert "Use the frontend server to compile pub executables (#2968)" (#3006) 492b15ba New binstubs for global activate using `dart pub` (#3002) e02f23bb fix grammer in .gitignore error message (#2995) e01e3a41 Use the frontend server to compile pub executables (#2968) 647989c6 Use RetryClient from package:http/retry.dart (#2980) ``` Original change's description: > Change-Id: I9a0b5fb2b5616a5a0eaa16f3a90205bb1bb1fc8f > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200878 > Auto-Submit: Jonas Jensen <[email protected]> > Commit-Queue: Alexander Thomas <[email protected]> > Reviewed-by: Alexander Thomas <[email protected]> Change-Id: I1a0570318c63ec97fd141d79b405f55105111077 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201260 Commit-Queue: Jonas Jensen <[email protected]> Reviewed-by: Alexander Thomas <[email protected]>
This issue was originally filed by @ahmetaa
This is a small language feature which may improve the readability of the numeric values. It would be nice optionally allowing underscore characters in numeric literals such as:
int a = 1_000_000;
int b = 0xffff_ffff;
inc c = 0b0010_1101_1111_1010; // suppose Dart has binary literals
This is implemented in Java7 http://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html
The text was updated successfully, but these errors were encountered: