Add ability to create T[int] AAs in the data segment#4571
Add ability to create T[int] AAs in the data segment#4571yebblies wants to merge 1 commit intodlang:masterfrom
Conversation
10e9f44 to
1cf3365
Compare
|
This goes very much against what we should do with AAs.
|
Yes, although I'm happy to be responsible for updating the compiler implementation to match the druntime one, if/when it changes.
I disagree, this is something that a library AA would/should support automatically.
I don't think this matters. The current situation is much, much worse as nothing is supported. Not even the trivial cases. The error message can clearly point out which cases don't work. Another year has gone by without a library AA becoming available. This should have worked a long time ago, even if it's only for the most common cases (integer/string keys). |
So you actually agree ;). Please let's not dissipate even more time going in the wrong direction, frustrating people, and trying to explain/document all of that. |
I... I don't think so. It's only magic if the library AA wouldn't support it. A library AA can be put in the data segment with the current compiler.
I think it's worthwhile, because this is a very frustrating limitation. I don't know when the library AA will be available. A year from now? Two? We can cover a huge number of use cases trivially by the next release. I don't think this is going in the wrong direction at all, from the user's perspective. If a library AA was to be implemented, the code I've added would never be reached as the AA literal would have been lowered to a struct/class expression already, so it doesn't hurt that effort apart from raising expectations. I think we've held back long enough, perfect is the enemy of better, etc
Yeah, nothing too serious. Supporting user-defined hashes of classes/structs is quite complicated (have to invoke ctfe, could fail) but all built-in types can be done fairly easily. (And will be done soon probably) |
Oh and all values are supported now, the limitation is just for keys. I've edited the PR title. |
|
It's been 5 months and we still don't have AAs in the data segment. |
|
We'd have to maintain, document, and justify this, please let's not waste out scarce time for another sloppy half-done feature. |
|
FYI. It was a pain supporting the 'new class' misfeature, and I certainly don't want to reverse engineer another complex format. AAs should be pushed into the library. I think this is the best direction to go in. |
|
Actually I agree w/ @ibuclaw, despite what we discussed at dconf. |
|
Yep. I've even used a (specialized) version of core.aa in other programs with relative success. |
|
I'll keep counting the years then. |
|
@yebblies could you close this please ? |
|
After two years with no progress, might was well. |
It's not that hard to support at least built-in types for AA keys.
Any interest? If so I can do other integral types and strings pretty easily.