-
-
Notifications
You must be signed in to change notification settings - Fork 702
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 mapSlice and fix Issue 16501 #4781
Conversation
Current coverage is 88.88% (diff: 92.47%)@@ master #4781 diff @@
==========================================
Files 124 121 -3
Lines 77343 74329 -3014
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 68485 66070 -2415
+ Misses 8858 8259 -599
Partials 0 0
|
5191c2e
to
648c25f
Compare
Seems you accidentally added internal.o... |
Thanks! |
7f0d1e5
to
9efc78e
Compare
auto opBinary(string op)(sizediff_t shift) | ||
if (op == `+` || op == `-`) | ||
{ | ||
auto ret = this; |
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.
was auto ret = this.ptrs;
.
This is fix for 16501. Unittest can be found below
e6f8290
to
c8fb4fa
Compare
@DmitryOlshansky could you please review / merge this PR? It is split into 2 commits. |
89a899f
to
9d6b9a5
Compare
version(LDC) | ||
{ | ||
static import ldc.attributes; | ||
alias fastmath = ldc.attributes.fastmath; |
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.
We might be a bit careful with this as LDC 1.1 isn't officially released.
@klickverbot is it common to compile a newer Phobos release with an older / stable LDC version?
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.
No. Phobos is merged with DMD FE
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.
Furthermore, it is not possible for many releases because new Phobos additions depend on new language, druntime or DMD FE changes.
@wilzbach maybe you can review / merge this please? |
Thanks! |
} | ||
|
||
enum FastmathDummy { init } | ||
FastmathDummy fastmathDummy() { return FastmathDummy.init; } |
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.
Perhaps nitpicks but:
- Can't
FastmathDummy
,fastmathDummy
andalias fastmath
be replaced with justenum fastmath;
- If
fmb
is declared aspackage
should these dummy symbols be that as well, or evenprivate
? - BTW, shouldn't all public symbols be
package
in this module, since it's an internal module?
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.
Can't FastmathDummy, fastmathDummy and alias fastmath be replaced with just enum fastmath;
I am not sure
If fmb is declared as package should these dummy symbols be that as well, or even private?
No
BTW, shouldn't all public symbols be package in this module, since it's an internal module?
No, this module is public because we need 1. Remove existing ndslice modules from Mir. 2. Have additional ndslice modules in Mir
This is part of #4652.
ndMap
was renamed tomapSlice
, it is correct, because we already have thisiotaSlice
,indexSlice
, andrepeatSlice
. OtherndXXX
algorithms are not part of this PR.Additional changes:
.slice
now public and moved to.internal
. This is done to allow Mir to remove already accepted modules from its code base.Pack
andMap
in internal is stuff that is new (but already reviewed in ndslice.algorithm #4652).The last commit also fix issue 16503.