-
-
Notifications
You must be signed in to change notification settings - Fork 421
Fix Issue 10535 - Add initialize function to allocate an empty AA #2504
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request and interest in making D better, @ntrel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + druntime#2504" |
You might want to have a look at a very similar attempt: |
* aa = The associative array. | ||
* See_Also: $(LREF clear) | ||
*/ | ||
void initialize(T : Value[Key], Value, Key)(ref T aa) @trusted |
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 don't like filling up the object
module with a lot of symbols. This is a pretty common name as well.
I guess it has been suggested before, but maybe it would be better to make
allocate the internal data struct. It currently yields a nonsense |
@wilzbach @jacob-carlborg Andrei suggested adding a function to initialize an empty AA, instead of adding built-in syntax, in 2013: @rainers |
|
I still don't like adding a new function for it. Using |
See changelog/docs for details. I'll make a dlang.org pull for this soon.
This is adapted from a patch by Ketmar Dark: https://issues.dlang.org/show_bug.cgi?id=16269#c4.
CC'ing @jmdavis @schveiguy.