July 15, 2008 Re: Initialization of the Associative arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ary Borenszweig | "Ary Borenszweig" <ary@esperanto.org.ar> wrote in message news:g5gpac$2hhf$1@digitalmars.com... <snip> > What use has a static array in comparison to a dynamic array? I'm not sure what you're talking about. Stewart. -- My e-mail address is valid but not my primary mailbox. Please keep replies on the 'group where everybody may benefit. |
July 15, 2008 Re: Initialization of the Associative arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | Stewart Gordon a écrit :
> "Ary Borenszweig" <ary@esperanto.org.ar> wrote in message news:g5gpac$2hhf$1@digitalmars.com...
> <snip>
>> What use has a static array in comparison to a dynamic array?
>
> I'm not sure what you're talking about.
>
> Stewart.
>
What I mean is which advantages gives you a static array that a dynamic array can't? The language seems full of cases where static arrays give problems. The only difference I can see is that they have a fixed length at compile time, and maybe that fact can be used for some optimizations. But does that optimization worths it to give the language such problems?
|
July 15, 2008 Re: Initialization of the Associative arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Reply to Bill,
>> I think much of this might come from the need to be able to eyeball
>> parse the code
>>
>> auto a = [ .... 16 different function calls ...];// what is the type
>> of a?
>>
> Who cares what the type is as long as it's sufficient to hold the
> results of all those function calls? If you cared you wouldn't have
> been using auto there.
>
"Who cares" is correct. Maybe not the guy who wrote it, but 6 months down the line it might crop up and make a big difference to someone else ("what overload is this using?", "Why can't I cast to X", "at what point will this overflow", etc.)
|
Copyright © 1999-2021 by the D Language Foundation