Thread overview | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
August 28, 2004 The array initialization bug | ||||
---|---|---|---|---|
| ||||
D is still carrying this bug for too long, IMHO. When will this be addressed? |
August 28, 2004 EDIT: The array initialization bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Id | (oops, I had hit the post message by mistake ¬¬') I'm talking about the: [code] public static void main() { int[] foo=[-1,0,1]; } [/code] mod1.d(3) variable foo is not a static and cannot have static initializer D is still carrying this bug for too long, IMHO. When will this be addressed? |
August 28, 2004 Re: The array initialization bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Id | "Id" <Id_member@pathlink.com> wrote in message news:cgq6q4$2urq$1@digitaldaemon.com... > I'm talking about the: > [code] > public static void main() > { > int[] foo=[-1,0,1]; > } > [/code] > mod1.d(3) variable foo is not a static and cannot have static initializer > > D is still carrying this bug for too long, IMHO. When will this be addressed? It's not a bug, since it is the way the language is specified. But supporting array (and struct) literals are very good candidates for 2.0 features. |
September 01, 2004 Re: The array initialization bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote: > "Id" <Id_member@pathlink.com> wrote in message > news:cgq6q4$2urq$1@digitaldaemon.com... <snip> >> mod1.d(3) variable foo is not a static and cannot have static initializer >> >> D is still carrying this bug for too long, IMHO. When will this be addressed? > > It's not a bug, since it is the way the language is specified. Whereabouts is this arbitrary restriction specified, exactly? And what is its advantage? And does this mean it's a misbug that the form's allowed for non-static class members? > But supporting array (and struct) literals are very good candidates for 2.0 > features. This isn't exactly an array literal, just the standard array initialisation syntax wanting to work wherever it ought to, and where it works perfectly in plain old C. http://www.digitalmars.com/drn-bin/wwwnews?D/26695 et seq.... Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
Copyright © 1999-2021 by the D Language Foundation