On Monday, 2 December 2013 at 16:52:51 UTC, bearophile wrote:
Atila Neves:
How would that go in this case?
An example usage:
void main() {
int[float][string] aa;
aa["foo"][1.5] = 1;
}
Bye,
bearophile
Oh. That makes sense. Doh!
I guess I was focussing on "key to AA of..." and that
On Tuesday, 3 December 2013 at 03:14:46 UTC, Jesse Phillips wrote:
On Monday, 2 December 2013 at 13:30:44 UTC, Atila Neves wrote:
It seems that assigning an AA to another makes both point at
the same data only if the first array has data to begin with.
Is that the expected behaviour?
Atila
On Monday, 2 December 2013 at 13:30:44 UTC, Atila Neves wrote:
It seems that assigning an AA to another makes both point at
the same data only if the first array has data to begin with.
Is that the expected behaviour?
Atila
You've been hit by the null associative array not being the same
as
Atila Neves:
How would that go in this case?
An example usage:
void main() {
int[float][string] aa;
aa["foo"][1.5] = 1;
}
Bye,
bearophile
On Monday, 2 December 2013 at 15:13:48 UTC, bearophile wrote:
Atila Neves:
int[string] aa[string];
Don't mix C style array definitions with D style ones :-)
Always use the D-style, unless you are porting C code (and
refactor it later).
How would that go in this case?
Atila Neves:
int[string] aa[string];
Don't mix C style array definitions with D style ones :-) Always
use the D-style, unless you are porting C code (and refactor it
later).
Bye,
bearophile
On Monday, 2 December 2013 at 13:30:44 UTC, Atila Neves wrote:
Bug or feature? This one caught me by surprise:
void main() {
{
int[string] aa[string];
aa["foo"]["bar"] = 1;
assert(aa["foo"]["bar"] == 1); //ok
auto aa2 = aa;
aa2["boo"]["dar"] = 2;
Bug or feature? This one caught me by surprise:
void main() {
{
int[string] aa[string];
aa["foo"]["bar"] = 1;
assert(aa["foo"]["bar"] == 1); //ok
auto aa2 = aa;
aa2["boo"]["dar"] = 2;
assert(aa["foo"]["bar"] == 1); //ok
}
{
int