We can't assign value to Variant associative array because there is a bug, I
found this :
http://d.puremagic.com/issues/show_bug.cgi?id=2451
So the issue is already assigned...I'm waiting.
Yes there is a .length for associative array and now aa.length works with the
last fix :
http://d.puremagic
I tried std.boxer,
Box[char[]][int] bb;
bb[0]["Month"] = box("Jan");
bb[0]["Profit"] = box(800);
bb[1]["Month"] = box("Jan");
bb[1]["Profit"] = box(200);
/*section work*/
writefln("%s",bb[0]["Month"]);
writefln("%d",bb[0]["Pro
GG wrote:
> Yes I can't use struct and/or enum because I can't know type and number of
> data that user could pass.
> In this example, we talk about Month, but it could be Minutes, week... So I
> try to program dynamic not static.
If you're trying to program dynamically, then you're using the
Yes I can't use struct and/or enum because I can't know type and number of data
that user could pass.
In this example, we talk about Month, but it could be Minutes, week... So I try
to program dynamic not static.
In fact I'm learning D thought a little project of graphic chart. I would like
to
Daniel Keep wrote:
> I got the following to work with Tango's Variant (dmd 1.051 + pre-0.99.9
> trunk):
>
> Variant[char[]][int] aa;
>
> aa[0] = typeof(aa[0]).init;
> aa[0]["Month"] = Variant("Jan");
> aa[0]["Profit"] = Variant(500);
>
> aa[1] = typeof(aa[0]).init;
> aa
GG wrote:
> I try to use variant as associative array with dmd2.039,
>
> Variant[char[]][int] aa;
> aa[0]["Month"] = "Jan";
> aa[0]["Profit"] = 500;
> aa[1]["Month"] = "Feb";
> aa[1]["Profit"] = 800;
>
> I g
On 10.02.2010 22:28, GG wrote:
> I try to use variant as associative array with dmd2.039,
>
> Variant[char[]][int] aa;
> aa[0]["Month"] = "Jan";
> aa[0]["Profit"] = 500;
> aa[1]["Month"] = "Feb";
> aa[1]["Profit"]
On Thu, Feb 11, 2010 at 21:22, GG wrote:
> I tried your trick but I got "Error: cannot append type string to type
> VariantN!(maxSize)[]"
> on : vars ~= "Jan";
>
> I found this : http://d.puremagic.com/issues/show_bug.cgi?id=3692, the
> issue has been REOPEN.
>
> Thanks for helping !
>
Hmm, it
Sorry, but I ckicked on REPLY and it created a new thread after posting!?
I tried your trick but I got "Error: cannot append type string to type
VariantN!(maxSize)[]"
on : vars ~= "Jan";
I found this : http://d.puremagic.com/issues/show_bug.cgi?id=3692, the issue
has been REOPEN.
Thanks for helping !
On Wed, Feb 10, 2010 at 22:28, GG wrote:
> I try to use variant as associative array with dmd2.039,
>
> I got core.exception.rangeer...@main(28): Range violation
>
I had the same problem a few months ago. It's the same with Algebraic, too
bad.
alias TypeTuple!(int, str
I try to use variant as associative array with dmd2.039,
Variant[char[]][int] aa;
aa[0]["Month"] = "Jan";
aa[0]["Profit"] = 500;
aa[1]["Month"] = "Feb";
aa[1]["Profit"] = 800;
I got core.exception.rangeer...@main(28): Range violatio
12 matches
Mail list logo