digitalmars.D - Associative Arrays in the data segment
- Daniel Murphy (19/19) Apr 10 2015 One long-standing issue with AAs has been that you can't generate consta...
- Andrea Fontana (2/23) Apr 10 2015 Why not 64bit integers?
- Daniel Murphy (5/6) Apr 10 2015 Integers <= 32 bits have a trivial hash implementation (the value is the...
- Daniel Kozak (2/23) Apr 10 2015 this would be awesome
- Jacob Carlborg (4/5) Apr 10 2015 Yes. Will there be the same limitations on the values as on the keys?
- Daniel Murphy (5/6) Apr 10 2015 No, values can be anything that is semantically valid and can currently ...
- Jacob Carlborg (4/8) Apr 10 2015 Cool :)
- ketmar (5/30) Apr 10 2015 this has a majour drawback, methinks: an inability to change AA=20
- Steven Schveighoffer (6/16) Apr 10 2015 I agree with ketmar, If the compiler implements this, then you cannot
- Daniel Murphy (5/15) Apr 10 2015 The AA implementation has changed once in the time I've been involved wi...
- Steven Schveighoffer (13/29) Apr 10 2015 It's all the rage these days, Walter just started a thread on it ;)
- Daniel Murphy (13/24) Apr 10 2015 Thread != activity.
- Steven Schveighoffer (17/42) Apr 10 2015 Well, it was a call to action by the language designer "here's a fun
- Daniel Murphy (8/20) Apr 10 2015 You're overestimating the difficulty of changing the implementation in t...
- Andrei Alexandrescu (5/30) Apr 10 2015 Sadly I'm among the folks who aren't jazzed by this. It seems like an
- Daniel Murphy (5/8) Apr 10 2015 If I'd been saying this three years ago I would have been right. We sho...
- Andrei Alexandrescu (4/12) Apr 10 2015 Can you make a salient argument that this is a step in the right
- Daniel Murphy (17/20) Apr 10 2015 This approach makes the common cases of AAs in the data segment work. T...
- Andrei Alexandrescu (3/23) Apr 11 2015 This is nice work, but sorry it is hardly conductive to warm fuzzy
- Daniel Murphy (3/5) Apr 11 2015 It's not ideal, just better than what we have now.
- Martin Nowak (2/4) Apr 10 2015 I'll better change it right now, have been cooking up some stuff.
- Gary Willoughby (4/6) Apr 10 2015 I think that was the gist of this conversation:
- H. S. Teoh via Digitalmars-d (18/26) Apr 10 2015 Didn't somebody submit some PRs for factoring out AA literal
- Daniel Murphy (4/14) Apr 10 2015 That's what tests are for.
- H. S. Teoh via Digitalmars-d (17/35) Apr 10 2015 The bigger problem is that this binds us even more to the current
- Daniel Murphy (16/30) Apr 10 2015 No, it doesn't.
- Martin Nowak (10/15) Apr 10 2015 It might make sense as an intermediate step. After all it's
- Daniel Murphy (8/16) Apr 10 2015 Oh, I agree. The current PR is just an example, although it supports a ...
- Martin Nowak (3/5) Apr 10 2015 Give me at least a few days. I have a new idea how to make that library
- deadalnix (2/8) Apr 10 2015 That would really be awesome !
- Steven Schveighoffer (5/10) Apr 10 2015 I'll await your idea, if not, I'll take a stab at it. Let me know if you...
One long-standing issue with AAs has been that you can't generate constant ones at compile time and access them at run-time. Workarounds are available, like initializing them in static this or using horribly inefficient enum AAs. I've opened https://github.com/D-Programming-Language/dmd/pull/4571 which allows code like this: immutable int[int] aa = [1 : 7, 3 : 2]; void main() { assert(aa[1] == 7); assert(aa[3] == 2); } It only works with integral types of at most 32-bits at the moment, but most built-in types are fairly easy to support. The downside is requires re-implementing druntime's AA and hashing algorithms in the compiler, and keeping them in sync when either changes. I think it's worthwhile, even if only integral and string keys are supported for now. That would cover 99% of my AA use. Is anybody else interested in seeing this in the next release?
Apr 10 2015
On Friday, 10 April 2015 at 07:54:44 UTC, Daniel Murphy wrote:One long-standing issue with AAs has been that you can't generate constant ones at compile time and access them at run-time. Workarounds are available, like initializing them in static this or using horribly inefficient enum AAs. I've opened https://github.com/D-Programming-Language/dmd/pull/4571 which allows code like this: immutable int[int] aa = [1 : 7, 3 : 2]; void main() { assert(aa[1] == 7); assert(aa[3] == 2); } It only works with integral types of at most 32-bits at the moment, but most built-in types are fairly easy to support. The downside is requires re-implementing druntime's AA and hashing algorithms in the compiler, and keeping them in sync when either changes. I think it's worthwhile, even if only integral and string keys are supported for now. That would cover 99% of my AA use. Is anybody else interested in seeing this in the next release?Why not 64bit integers?
Apr 10 2015
"Andrea Fontana" wrote in message news:nrlbhbhqutcmuyzkmspx forum.dlang.org...Why not 64bit integers?Integers <= 32 bits have a trivial hash implementation (the value is the hash) so I did them first. 64-bit ints, strings, arrays etc need the multi-byte hash which I haven't gotten around to yet.
Apr 10 2015
On Friday, 10 April 2015 at 07:54:44 UTC, Daniel Murphy wrote:One long-standing issue with AAs has been that you can't generate constant ones at compile time and access them at run-time. Workarounds are available, like initializing them in static this or using horribly inefficient enum AAs. I've opened https://github.com/D-Programming-Language/dmd/pull/4571 which allows code like this: immutable int[int] aa = [1 : 7, 3 : 2]; void main() { assert(aa[1] == 7); assert(aa[3] == 2); } It only works with integral types of at most 32-bits at the moment, but most built-in types are fairly easy to support. The downside is requires re-implementing druntime's AA and hashing algorithms in the compiler, and keeping them in sync when either changes. I think it's worthwhile, even if only integral and string keys are supported for now. That would cover 99% of my AA use. Is anybody else interested in seeing this in the next release?this would be awesome
Apr 10 2015
On 2015-04-10 09:54, Daniel Murphy wrote:Is anybody else interested in seeing this in the next release?Yes. Will there be the same limitations on the values as on the keys? -- /Jacob Carlborg
Apr 10 2015
"Jacob Carlborg" wrote in message news:mg8296$q6r$1 digitalmars.com...Yes. Will there be the same limitations on the values as on the keys?No, values can be anything that is semantically valid and can currently be put in the data segment. The currently limited selection of key types is because the hashing needs to be re-implemented in the compiler. eg Object[int] and int[int][int] both work fine.
Apr 10 2015
On 2015-04-10 11:19, Daniel Murphy wrote:No, values can be anything that is semantically valid and can currently be put in the data segment. The currently limited selection of key types is because the hashing needs to be re-implemented in the compiler. eg Object[int] and int[int][int] both work fine.Cool :) -- /Jacob Carlborg
Apr 10 2015
On Fri, 10 Apr 2015 17:54:47 +1000, Daniel Murphy wrote:One long-standing issue with AAs has been that you can't generate constant ones at compile time and access them at run-time. Workarounds are available, like initializing them in static this or using horribly inefficient enum AAs. =20 I've opened https://github.com/D-Programming-Language/dmd/pull/4571 which allows code like this: =20 immutable int[int] aa =3D [1 : 7, 3 : 2]; =20 void main() { assert(aa[1] =3D=3D 7); assert(aa[3] =3D=3D 2); } =20 It only works with integral types of at most 32-bits at the moment, but most built-in types are fairly easy to support. The downside is requires re-implementing druntime's AA and hashing algorithms in the compiler, and keeping them in sync when either changes. =20 I think it's worthwhile, even if only integral and string keys are supported for now. That would cover 99% of my AA use. =20 Is anybody else interested in seeing this in the next release?this has a majour drawback, methinks: an inability to change AA=20 implementation without fixing the compiler too. i.e. i can't no longer to=20 simply rewrite the relevant parts of druntime (change hashing function,=20 for example) and be happy.=
Apr 10 2015
On 4/10/15 9:04 AM, ketmar wrote:On Fri, 10 Apr 2015 17:54:47 +1000, Daniel Murphy wrote:It only works with integral types of at most 32-bits at the moment, but most built-in types are fairly easy to support. The downside is requires re-implementing druntime's AA and hashing algorithms in the compiler, and keeping them in sync when either changes.this has a majour drawback, methinks: an inability to change AA implementation without fixing the compiler too. i.e. i can't no longer to simply rewrite the relevant parts of druntime (change hashing function, for example) and be happy.I agree with ketmar, If the compiler implements this, then you cannot play with the implementation of AA at all without changing the compiler. I'd rather see the compiler treat AA as fully library type, and be able to build AA at compile time because the code is sane. -Steve
Apr 10 2015
"Steven Schveighoffer" wrote in message news:mg8ihs$1at6$1 digitalmars.com...The AA implementation has changed once in the time I've been involved with D. I don't see this as a big concern.this has a majour drawback, methinks: an inability to change AA implementation without fixing the compiler too. i.e. i can't no longer to simply rewrite the relevant parts of druntime (change hashing function, for example) and be happy.I agree with ketmar, If the compiler implements this, then you cannot play with the implementation of AA at all without changing the compiler.I'd rather see the compiler treat AA as fully library type, and be able to build AA at compile time because the code is sane.Who wouldn't? But realistically, how many more years until that happens?
Apr 10 2015
On 4/10/15 9:44 AM, Daniel Murphy wrote:"Steven Schveighoffer" wrote in message news:mg8ihs$1at6$1 digitalmars.com...It's all the rage these days, Walter just started a thread on it ;) But the issue I see is that this is a step BACKWARDS. We want to move to more possibility of customization, not less. Subtle differences in compiler/library implementation are the stuff nightmare bugs are made of.The AA implementation has changed once in the time I've been involved with D. I don't see this as a big concern.this has a majour drawback, methinks: an inability to change AA implementation without fixing the compiler too. i.e. i can't nolonger > tosimply rewrite the relevant parts of druntime (change hashing function, for example) and be happy.I agree with ketmar, If the compiler implements this, then you cannot play with the implementation of AA at all without changing the compiler.I think it's possible now, but nobody has been able to exactly duplicate certain aspects of the builtin AA. I may take a stab at it. We also had a horrible experience of "half-library half magic" type a few years ago. But the real answer is, as soon as someone does it who has Walter's/Kenji's/your ear, we can create an AA, and fix the compiler to use and support it. It needs an advocate (who is willing to do the hard work). -SteveI'd rather see the compiler treat AA as fully library type, and be able to build AA at compile time because the code is sane.Who wouldn't? But realistically, how many more years until that happens?
Apr 10 2015
"Steven Schveighoffer" wrote in message news:mg8ln4$1dtb$1 digitalmars.com...It's all the rage these days, Walter just started a thread on it ;)Thread != activity.But the issue I see is that this is a step BACKWARDS. We want to move to more possibility of customization, not less. Subtle differences in compiler/library implementation are the stuff nightmare bugs are made of.It lets us do something we currently can't do but want to, at the cost of making something we could do but haven't for years slightly harder. If somebody really wants to improve the runtime AA implementation, they can a) Update the compiler code to do the same thing b) Ask me and I'll do it Not being able to put AAs in the data segment is a stupid limitation that we should have fixed years ago.I think it's possible now, but nobody has been able to exactly duplicate certain aspects of the builtin AA. I may take a stab at it. We also had a horrible experience of "half-library half magic" type a few years ago.The only positive thing that's made it into master in the last few years is rolling back the AA implementation.But the real answer is, as soon as someone does it who has Walter's/Kenji's/your ear, we can create an AA, and fix the compiler to use and support it. It needs an advocate (who is willing to do the hard work).I'm not holding my breath.
Apr 10 2015
On 4/10/15 10:20 AM, Daniel Murphy wrote:"Steven Schveighoffer" wrote in message news:mg8ln4$1dtb$1 digitalmars.com...Well, it was a call to action by the language designer "here's a fun project anyone can do". Would be a shame for an unsuspecting person to do that, and then find out "oh, we can't use your work, because the compiler has an implementation already, and (insert some wrinkle why it's too difficult to update the compiler version to do what yours does)"It's all the rage these days, Walter just started a thread on it ;)Thread != activity.Yes, I understand this. But I'm very firmly against putting more magic into the compiler. How many bugs or barriers to improvement are root caused by compiler magic treatment of something?But the issue I see is that this is a step BACKWARDS. We want to move to more possibility of customization, not less. Subtle differences in compiler/library implementation are the stuff nightmare bugs are made of.It lets us do something we currently can't do but want to, at the cost of making something we could do but haven't for years slightly harder.If somebody really wants to improve the runtime AA implementation, they can a) Update the compiler code to do the same thing b) Ask me and I'll do it Not being able to put AAs in the data segment is a stupid limitation that we should have fixed years ago.There are many stupid limitations that should have been fixed years ago. And I don't disagree this is one of them. I just disagree that this is a "fix". It's quite literally the introduction of a new problem that we don't need.No, the most significant change is making it so opEquals is used instead of opCmp for key lookup. And that was like pulling teeth.I think it's possible now, but nobody has been able to exactly duplicate certain aspects of the builtin AA. I may take a stab at it. We also had a horrible experience of "half-library half magic" type a few years ago.The only positive thing that's made it into master in the last few years is rolling back the AA implementation.Clearly :) -SteveBut the real answer is, as soon as someone does it who has Walter's/Kenji's/your ear, we can create an AA, and fix the compiler to use and support it. It needs an advocate (who is willing to do the hard work).I'm not holding my breath.
Apr 10 2015
"Steven Schveighoffer" wrote in message news:mg8nd3$1fq5$1 digitalmars.com...Well, it was a call to action by the language designer "here's a fun project anyone can do". Would be a shame for an unsuspecting person to do that, and then find out "oh, we can't use your work, because the compiler has an implementation already, and (insert some wrinkle why it's too difficult to update the compiler version to do what yours does)"You're overestimating the difficulty of changing the implementation in the compiler.Yes, I understand this. But I'm very firmly against putting more magic into the compiler. How many bugs or barriers to improvement are root caused by compiler magic treatment of something?Not that many? How many improvements don't happen despite lack of barriers?There are many stupid limitations that should have been fixed years ago. And I don't disagree this is one of them. I just disagree that this is a "fix". It's quite literally the introduction of a new problem that we don't need.It's trading one problem for another. Current problem: feature doesn't work. New problem: somebody might have more trouble doing something they probably won't do anyway. It's a win.
Apr 10 2015
On 4/10/15 7:20 AM, Daniel Murphy wrote:"Steven Schveighoffer" wrote in message news:mg8ln4$1dtb$1 digitalmars.com...Sadly I'm among the folks who aren't jazzed by this. It seems like an evolutionary backward step of only short-lived value. It's telling that some of the supporting arguments count on bad things not improving. AndreiIt's all the rage these days, Walter just started a thread on it ;)Thread != activity.But the issue I see is that this is a step BACKWARDS. We want to move to more possibility of customization, not less. Subtle differences in compiler/library implementation are the stuff nightmare bugs are made of.It lets us do something we currently can't do but want to, at the cost of making something we could do but haven't for years slightly harder. If somebody really wants to improve the runtime AA implementation, they can a) Update the compiler code to do the same thing b) Ask me and I'll do it Not being able to put AAs in the data segment is a stupid limitation that we should have fixed years ago.I think it's possible now, but nobody has been able to exactly duplicate certain aspects of the builtin AA. I may take a stab at it. We also had a horrible experience of "half-library half magic" type a few years ago.The only positive thing that's made it into master in the last few years is rolling back the AA implementation.But the real answer is, as soon as someone does it who has Walter's/Kenji's/your ear, we can create an AA, and fix the compiler to use and support it. It needs an advocate (who is willing to do the hard work).I'm not holding my breath.
Apr 10 2015
"Andrei Alexandrescu" wrote in message news:mg8s3d$1jn5$1 digitalmars.com...Sadly I'm among the folks who aren't jazzed by this. It seems like an evolutionary backward step of only short-lived value. It's telling that some of the supporting arguments count on bad things not improving.If I'd been saying this three years ago I would have been right. We should move towards something better, instead of sitting still and waiting for perfect.
Apr 10 2015
On 4/10/15 9:15 AM, Daniel Murphy wrote:"Andrei Alexandrescu" wrote in message news:mg8s3d$1jn5$1 digitalmars.com...Can you make a salient argument that this is a step in the right direction? In that case what's the vision for future steps? Thanks! -- AndreiSadly I'm among the folks who aren't jazzed by this. It seems like an evolutionary backward step of only short-lived value. It's telling that some of the supporting arguments count on bad things not improving.If I'd been saying this three years ago I would have been right. We should move towards something better, instead of sitting still and waiting for perfect.
Apr 10 2015
"Andrei Alexandrescu" wrote in message news:mg94od$1v4g$1 digitalmars.com...Can you make a salient argument that this is a step in the right direction? In that case what's the vision for future steps? Thanks! -- AndreiThis approach makes the common cases of AAs in the data segment work. This enables a very useful idiom of defining a constant lookup table and using it at runtime to map values. The hashing and AA implementations that need to be replicated in the compiler are trivial, and easily updated if anybody does change the druntime implementation. At worst it's pretty much a copy-paste from the druntime sources. And as I've said, I'm happy provide a matching dmd implementation of anybody's new druntime implementation. A future library AA implementation would not be complicated by this patch, because the code in this patch is only reached when an AA literal survives until codegen. A library AA would lower the AA literal to some other construct before codegen. This is a step in the right direction because it will make the common cases of this feature work. That's it. It doesn't hurt or help other AA issues in a significant way.
Apr 10 2015
On 4/10/15 8:45 PM, Daniel Murphy wrote:"Andrei Alexandrescu" wrote in message news:mg94od$1v4g$1 digitalmars.com...This is nice work, but sorry it is hardly conductive to warm fuzzy feelings. -- AndreiCan you make a salient argument that this is a step in the right direction? In that case what's the vision for future steps? Thanks! -- AndreiThis approach makes the common cases of AAs in the data segment work. This enables a very useful idiom of defining a constant lookup table and using it at runtime to map values. The hashing and AA implementations that need to be replicated in the compiler are trivial, and easily updated if anybody does change the druntime implementation. At worst it's pretty much a copy-paste from the druntime sources. And as I've said, I'm happy provide a matching dmd implementation of anybody's new druntime implementation. A future library AA implementation would not be complicated by this patch, because the code in this patch is only reached when an AA literal survives until codegen. A library AA would lower the AA literal to some other construct before codegen. This is a step in the right direction because it will make the common cases of this feature work. That's it. It doesn't hurt or help other AA issues in a significant way.
Apr 11 2015
"Andrei Alexandrescu" wrote in message news:mgcqml$2e67$1 digitalmars.com...This is nice work, but sorry it is hardly conductive to warm fuzzy feelings. -- AndreiIt's not ideal, just better than what we have now.
Apr 11 2015
On Friday, 10 April 2015 at 13:44:27 UTC, Daniel Murphy wrote:Who wouldn't? But realistically, how many more years until that happens?I'll better change it right now, have been cooking up some stuff.
Apr 10 2015
On Friday, 10 April 2015 at 13:17:48 UTC, Steven Schveighoffer wrote:I'd rather see the compiler treat AA as fully library type, and be able to build AA at compile time because the code is sane.I think that was the gist of this conversation: http://forum.dlang.org/thread/mg13tc$2ptk$1 digitalmars.com
Apr 10 2015
On Fri, Apr 10, 2015 at 05:54:47PM +1000, Daniel Murphy via Digitalmars-d wrote:One long-standing issue with AAs has been that you can't generate constant ones at compile time and access them at run-time. Workarounds are available, like initializing them in static this or using horribly inefficient enum AAs.Didn't somebody submit some PRs for factoring out AA literal initializations? Whatever happened with that? In theory, that should have been the first step in allowing compile-time initialized AAs. [...]It only works with integral types of at most 32-bits at the moment, but most built-in types are fairly easy to support. The downside is requires re-implementing druntime's AA and hashing algorithms in the compiler, and keeping them in sync when either changes.I think this is unacceptable. We're trying to decouple AA's from compiler innards, and this is going backwards and adding a huge dependency between them again, not to mention being a maintenance nightmare because bugs are bound to happen when the two code bases go out of sync. It's the very problem we've been trying to fix for years. While I am very much in favor of compile-time initialized AA's (been wanting that for years now), I think this is not the right approach. In my mind, the correct approach is to factor out the AA implementation into a library solution, and use CTFE on that library code to generate the compile-time initialized literal. T -- "A one-question geek test. If you get the joke, you're a geek: Seen on a California license plate on a VW Beetle: 'FEATURE'..." -- Joshua D. Wachs - Natural Intelligence, Inc.
Apr 10 2015
"H. S. Teoh via Digitalmars-d" wrote in message news:mailman.1417.1428680037.3111.digitalmars-d puremagic.com...I think this is unacceptable. We're trying to decouple AA's from compiler innards, and this is going backwards and adding a huge dependency between them again, not to mention being a maintenance nightmare because bugs are bound to happen when the two code bases go out of sync. It's the very problem we've been trying to fix for years.That's what tests are for.While I am very much in favor of compile-time initialized AA's (been wanting that for years now), I think this is not the right approach. In my mind, the correct approach is to factor out the AA implementation into a library solution, and use CTFE on that library code to generate the compile-time initialized literal.How many years are you willing to wait for the 'correct approach'?
Apr 10 2015
On Sat, Apr 11, 2015 at 01:48:10AM +1000, Daniel Murphy via Digitalmars-d wrote:"H. S. Teoh via Digitalmars-d" wrote in message news:mailman.1417.1428680037.3111.digitalmars-d puremagic.com...The bigger problem is that this binds us even more to the current schizophrenic split of the AA implementation between the compiler and druntime. We've been trying to break away from that for years, and now you're suggesting to bring us back to square one.I think this is unacceptable. We're trying to decouple AA's from compiler innards, and this is going backwards and adding a huge dependency between them again, not to mention being a maintenance nightmare because bugs are bound to happen when the two code bases go out of sync. It's the very problem we've been trying to fix for years.That's what tests are for.Didn't somebody (IIRC Igor Stepanov?) submit a bunch of PRs in this direction? I.e., precisely to factor out AA-specific interfaces in the compiler so that everything goes through a standard API that eventually can be swapped for proxies to a library implementation? While it's true I haven't seen activity on this front for a while now, I was under the impression things were moving along quite well. If we all were to get behind this effort and push it through instead of going back to the bad ole split-implementation approach, maybe it would have seen the light of day already. T -- It is of the new things that men tire --- of fashions and proposals and improvements and change. It is the old things that startle and intoxicate. It is the old things that are young. -- G.K. ChestertonWhile I am very much in favor of compile-time initialized AA's (been wanting that for years now), I think this is not the right approach. In my mind, the correct approach is to factor out the AA implementation into a library solution, and use CTFE on that library code to generate the compile-time initialized literal.How many years are you willing to wait for the 'correct approach'?
Apr 10 2015
"H. S. Teoh via Digitalmars-d" wrote in message news:mailman.1420.1428683081.3111.digitalmars-d puremagic.com...The bigger problem is that this binds us even more to the current schizophrenic split of the AA implementation between the compiler and druntime.No, it doesn't.We've been trying to break away from that for years, and now you're suggesting to bring us back to square one.No, I'm not.Didn't somebody (IIRC Igor Stepanov?) submit a bunch of PRs in this direction? I.e., precisely to factor out AA-specific interfaces in the compiler so that everything goes through a standard API that eventually can be swapped for proxies to a library implementation? While it's true I haven't seen activity on this front for a while now, I was under the impression things were moving along quite well. If we all were to get behind this effort and push it through instead of going back to the bad ole split-implementation approach, maybe it would have seen the light of day already.We're not going back to anything, it's an improvement to the current implementation. I'd love to be proven wrong, but what you said is not likely to happen. Instead people are going to say "we should do it this way!" and nothing will get done. And even if it did happen, it would replace the code I'm adding, not conflict with it. ie this change is a new glue layer expansion of AssocArrayLiteralExp, and with a library AA that expression would already be converted to a struct literal/class exp/etc. The only argument I've heard against this change that actually has merit is that it will make it harder to change the internals of the current AA. I'm happy to provide compiler versions of any new druntime AA implementations, it's not very difficult.
Apr 10 2015
On Friday, 10 April 2015 at 07:54:44 UTC, Daniel Murphy wrote:It only works with integral types of at most 32-bits at the moment, but most built-in types are fairly easy to support. The downside is requires re-implementing druntime's AA and hashing algorithms in the compiler, and keeping them in sync when either changes.It might make sense as an intermediate step. After all it's fairly simple and who knows how long we'll take to change the AA implementation. But what I find unacceptable is a lousy intermediate solution that supports int, but not short and only if the value isn't a const string or a class starting with the letter K. I don't want to add another facet to the already long AA story. So if you can fix the problem and are willing to do the work, go on. Just adding a tiny hack makes the situation worse IMO.
Apr 10 2015
"Martin Nowak" wrote in message news:apzvykkdevzgmqbsldke forum.dlang.org...It might make sense as an intermediate step. After all it's fairly simple and who knows how long we'll take to change the AA implementation. But what I find unacceptable is a lousy intermediate solution that supports int, but not short and only if the value isn't a const string or a class starting with the letter K. I don't want to add another facet to the already long AA story. So if you can fix the problem and are willing to do the work, go on. Just adding a tiny hack makes the situation worse IMO.Oh, I agree. The current PR is just an example, although it supports a lot more than just int as keys. Current support is int,uint,short,ushort,byte,ubyte,char,wchar,dchar as keys, anything that can be used to initialize a global as a value. At the very least it will support all integral basic types and arrays of integral types. (which includes strings)
Apr 10 2015
On 04/10/2015 09:54 AM, Daniel Murphy wrote:Is anybody else interested in seeing this in the next release?Give me at least a few days. I have a new idea how to make that library AA happen. Might be able to implement that over the weekend.
Apr 10 2015
On Saturday, 11 April 2015 at 00:22:43 UTC, Martin Nowak wrote:On 04/10/2015 09:54 AM, Daniel Murphy wrote:That would really be awesome !Is anybody else interested in seeing this in the next release?Give me at least a few days. I have a new idea how to make that library AA happen. Might be able to implement that over the weekend.
Apr 10 2015
On 4/10/15 8:22 PM, Martin Nowak wrote:On 04/10/2015 09:54 AM, Daniel Murphy wrote:I'll await your idea, if not, I'll take a stab at it. Let me know if you need help. This needs to get solved. I hope it works! -SteveIs anybody else interested in seeing this in the next release?Give me at least a few days. I have a new idea how to make that library AA happen. Might be able to implement that over the weekend.
Apr 10 2015