Top 5
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Wed Oct 8 15:30:21 PDT 2008
Denis Koroskin wrote:
> On Thu, 09 Oct 2008 00:07:27 +0400, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>
>> Ok, per Aarti's suggestion: without speaking officially for Walter,
>> let me ask this - what do you think are the top issues you'd like to
>> see fixed in D?
>>
>> Andrei
>
> Oh, I forgot about these:
>
> - omittable parens - bad feature. I wish a real property syntax existed
> (with only .foo; allowed, no .foo(); please).
This doesn't have much support from Walter, I'm afraid.
> [Minor|Wish] overlapping array operation. The following should be
> allowed, even if it makes things slightly slower. Why user should care?
> void foo(T[] t1, T[] t2) {
> ...
> t1[] = t2[]; // overlap or not? who knows..
> t1[0..100] = t1[10..110]; // yes, they do, so what?
> ...
> }
I think this often indicates an error.
> [Wish] Stack allocation - why allocate on heap when you can allocate on
> stack?
>
> void drawString(char[] text) {
> int length = getLengthAsUtf16String(text); // for leading zero
> wchar[length + 1] buffer; // C++ and C++0x both
> have this feature
> convertToUtf16String(text, buffer); buffer[length] = 0;
> graphics.DrawString(font, color, buffer.ptr);
> }
>
> Do you write down? :)
> Thanks.
Neither C++ nor C++0x have that feature. C99 does (VLAs). But I do think
it's a useful feature. In a class I taught that entailed teaching
students some C, most of them actually tried VLAs naturally without
knowing about it, gcc accepted it, and they used it to great effect.
Andrei
More information about the Digitalmars-d
mailing list