-
-
Notifications
You must be signed in to change notification settings - Fork 743
move format to std.format #2732
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
Conversation
@@ -1503,8 +1503,6 @@ private auto packedArrayView(T)(inout(size_t)* ptr, size_t items) @trusted pure | |||
// Partially unrolled binary search using Shar's method | |||
//============================================================================ | |||
|
|||
private import std.math : pow; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. ^^
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last time I checked it required std.math.pow
maybe it doesn't now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't
@@ -576,7 +576,7 @@ unittest | |||
{ | |||
import std.functional; | |||
import std.algorithm : find; | |||
import std.uni : isWhite; | |||
import std.ascii : isWhite; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do not import std.uni
. For this unittest
any isWhite
is good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a bit extreme. This is a unittest, not a function everyone is going to use. Why does an import inside a unittest matter so much? If it's actually a problem, then we need to be addressing the root cause of the problem (on the forum) instead of just randomly removing things from Phobos unittests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not matter =) I will remove this change after other recommendations will be given.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other recommendations - it is about all PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let's avoid the use of std.ascii
in the documented unittest, no need to encourage avoiding Unicode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
Otherwise LGTM. The comment about |
The reason is to do not import `std.uni` tables, `std.string` and probably `std.algorithm`. Note that format is used in CTFE code and `Exception` handing. And it is more comfortable to import `format` from `std.format`. std.format: clean imports (2) remove import std.math : pow from std.uni update scope imports in std.algorithm update scope imports in std.exception doFormat -> template update scope imports in std.typecons update scope imports in std.functional update scope imports in std.range update std.conv scope import std.format: clean imports (2) remove import std.math : pow from std.uni update scope imports in std.algorithm update scope imports in std.exception doFormat -> template update scope imports in std.typecons update scope imports in std.functional update scope imports in std.range move sfromat add public import of sformat use std.uni
|
LGTM, thanks! |
On second thoughts, what about DMD bug https://issues.dlang.org/show_bug.cgi?id=13745? Will this move cause problems because of that bug? |
The unittests pass until changes in UTFException. So it can be merged. |
Auto-merge toggled on |
move format to std.format
Blocked by DMD Issue: https://issues.dlang.org/show_bug.cgi?id=13745History of this PR with commits: https://github.com/9il/phobos/tree/move2
See also: #2737
The reason is to do not import
std.uni
tables,std.string
andprobably
std.algorithm
.Public import
format
added instd.string
with docs likeicmp
.