Re: use variant as associative array

2010-02-11 Thread GG
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

Re: use variant as associative array

2010-02-11 Thread Daniel Keep
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

Re: use variant as associative array

2010-02-11 Thread GG
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

Re: use variant as associative array

2010-02-11 Thread Daniel Keep
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

Re: use variant as associative array

2010-02-11 Thread Daniel Keep
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 got core.exception.rangeer...@main(28): Range violation > I'm doing something wrong ? Or

Re: use variant as associative array

2010-02-11 Thread downs
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"] = 800; > > I got core.exception.rangeer...@main(28): Range violation > I'm doing s

Re: Unexpected behaviour on socket

2010-02-11 Thread downs
On 10.02.2010 14:41, daoryn wrote: >> >> The buffer you are passing to receive is 0 bytes long. The >> std.socket.Socket.receive function is a wrapper over the normal socket >> function, and includes a test for an empty buffer. >> >> Daniel > > Ohh, I see. Thank you! > > I thought that the fun

Re: use variant as associative array

2010-02-11 Thread Philippe Sigaud
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

Re: use variant as associative array

2010-02-11 Thread GG
Sorry, but I ckicked on REPLY and it created a new thread after posting!?

Re: use variant as associative array

2010-02-11 Thread GG
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 !

Re: use variant as associative array

2010-02-11 Thread Philippe Sigaud
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, string, double, char) Univers

Alias parameters in nested templates

2010-02-11 Thread Tomek Sowiński
I've been playing with templates recently and there's something I don't quite get. template Outer() { template Inner(alias param) { alias param Inner; } } void main() { long d; Outer!().Inner!(d) = 4; // fails } Error: template instance cannot use local 'd' as paramete

servicos especializados de informatica vitoria-es 99297

2010-02-11 Thread Assitencia manutencao remocao de virus computador pc
Contato: pcnetsecur...@gmail.com Contato: pcnetsecurity @ gmail.com Assistência Técnica Prestamos assistência técnica nos computadores de sua empresa ou residência, e também possuímos uma equipe qualificada para fazer a manutenção no próprio local. - Contratos de Suporte e Manutenção Reduza os