the best language I have ever met(?)
Igor Shirkalin via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Dec 2 12:38:56 PST 2016
On Monday, 28 November 2016 at 16:15:23 UTC, Jonathan M Davis
wrote:
> That's what pragma(inline, true) is for. And if someone wants a
> different solution that's completely compile-time and doesn't
> work with variables, then fine. I'm talking about adding
> something to the standard library, and for that, I think that a
> solution that is as close as possible to being identical to
> simply declaring the static array with the length is what would
> be appropriate.
>
>>...
>
> I'm not married to the syntax. I tried that syntax, but I
> couldn't figure out how to get it to work with runtime values.
>
Can I insert my own opinion about static arrays with programmers'
unknown size?
Being the practical developer I can't imagine the situation where
it is really needed. I hope D is not for theoretical goals only
but for practical ones first.
If we know the size of our future array we tell that to the
compiler. If we don't know the size of our future static array we
write an external generator to produce that. I really don't know
places where I want static array to be unknown size inline
(perhaps, except for debugging purposes). Concluding, the
designer knows he's achived the perfection if there is nothing to
remove, but not to add.
Igor Shirkalin
More information about the Digitalmars-d-learn
mailing list