-
Notifications
You must be signed in to change notification settings - Fork 20
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
better access to allowDownsize #18
Comments
You can make an alias |
Yeah, but my point was that this is a rather common pattern and the alias should be within mir ;-) |
The main problem is good function name) |
|
@John-Colvin what do you think? @greenify John is native English speaker. |
I'm not convinced that it's necessary/beneficial to have an alias at all. @greenify what important use-cases do you have for the Yes.allowDownsize semantics? I don't really see the value in it, but perhaps I'm not being imaginative enough |
it happened quite often to me in NumPy and my point was more that I have to select the option for I can still repeat the example given above: iota(10).sliced!(Yes.replaceArrayWithPointer, Yes.allowDownsize)(4); or let's say I initially created lots of random numbers and want to seed my arrays:
It's hard to come up with a really "good" usecase, because one can always argue: hey that's your fault. |
Update: If I look through the current documentation at Phobos I see this pattern to have a larger input source quite often, that's btw why I was a bit surprised when I realized that you might have changed the defaults. So all those definitions fail and need to replaced with the bulky thing from above:
|
Closing this for now - though we shouldn't forget when we create new APIs that such template flags are dependent on the order and access to the last ones might be inconvenient ;-) |
It seems that this that the default flag for allowDownsize has been recently changed - (at least for the latest version in phobos).
This makes sense, but we should have a handy access to the flag, this is annoying!
The text was updated successfully, but these errors were encountered: