Should we remove int[$] before 2.067?

eles via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 1 01:32:57 PST 2015


On Saturday, 31 January 2015 at 07:19:47 UTC, Andrei Alexandrescu 
wrote:
> On 1/30/15 11:00 PM, eles wrote:
>> On Friday, 30 January 2015 at 18:08:15 UTC, Gary Willoughby 
>> wrote:
>>> On Friday, 30 January 2015 at 14:47:22 UT

> How is anything about specifying the length of a constant array 
> revolutionary?

No. This is not revolutionary, but you are making of it a such 
fearsome perspective that one's feels like it will gonna blow 
away the language.

And when I spoke about the revolution that might be wrong, I 
didn't speak about this.

But precisely of this:

The wrong revolution in D is the GC.

Yes, in that respect, D was revolutionary. And wrong.

A lot of effort, see the recent threads about embedded and 
realtime, are just wasted energy to alleviate the outcomes of 
this one bad choice. It seems that the hardest fight the D users 
have to tackle is with the GC. Just have a look at all the 
efforts made in this direction (even the allocators and so on), 
and especially at the *abandoned efforts*.

Anyway, I did not want to develop the topic on this thread 
because i is a different thing.

>
>> Certainly, you end up by being both conservative and 
>> revolutionary. But,
>> neither when it is needed.
>>
>> I really support the syntax. Because makes one quirk less.
>
> Special syntax for a niche case instead of using a function... 
> looks one quirk more, not less.

It looks to you that suddenly being forced to go from:

int[3] x = [1, 2, 3];

to

staticArray!(int, auto) sarray = [1, 2, 3];

or from

auto[$][][$] = [
    [[1,2]],
    [[3,4], [5,6]],
    [[7,8], [9,10], [11,12]],
];

to

alias s = staticArray;
auto arr = staticArray(
       [[1,2].s],
       [[3,4].s, [5,6].s],
       [[7,8].s, [9,10].s, [11,12].s],
  );

is a kind of clear, crisp and obvious change?

Frankly, the latter example ae rather a special syntax, not the 
first one. There, the meaning is almost clear: "I want  static 
string of a length that I don't want to spend effort in order to 
count it by hand".

Don't tell me that you did never count characters on the screen 
with the keyboard, mouse or the finger?

Now, look again at the examples above and *then* ask yourself 
which is the more unnatural and special syntax.

God, you cannot even get away of that "auto" (which translates 
into: "I, as a designer, I hide my inability to define a clear 
syntax here behind this sugar of auto").

So, as I was telling, you manage to be both revolutionary and 
conservative, just both wrong.

You went the revolutionary road with the GC and so on, sparkling 
a lot of effort and discussions just to cope with that wrong 
choice, but you held on onto it, with the determination of 
IndburIII.

Then, you fight with all your energy against little things that 
will much sweeten the language, fearful of changes because, after 
doing one wrong, you fear even the good ones. And you call this 
being "cautious".

Whatever, anyway.



More information about the Digitalmars-d mailing list