August 15, 2007 Re: string not aliased | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Brossollet | Charles Brossollet Wrote:
> Hi all,
>
> I'm a complete newbie to D, and tried the examples on the Wikipedia page. the example 2 shows a main function like this:
>
> int main(string[] args) // string is a type alias for const(char)[]
>
> But, I get this error on compile:
> hello.d:3: Error: identifier 'string' is not defined
> hello.d:3: Error: string is used as a type
> hello.d:3: function hello.main parameters must be main() or
> main(char[][] args)
>
> Is the guy writing the example wrong? Or is it my environment? (gdc
> 0.23, on Mac OSX 10.4)
The current gdc supports d version 1.x. The example you're doing, I believe, is for an alpha version of d (version 2.x). const(char) and various const/final/invariant stuff was added in 2.x (and is the reason for the version # increase and calling it an alpha release)
|
August 15, 2007 Re: string not aliased | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Brossollet | Charles Brossollet wrote:
> Hi all,
>
> I'm a complete newbie to D, and tried the examples on the Wikipedia page. the example 2 shows a main function like this:
>
> int main(string[] args) // string is a type alias for const(char)[]
>
> But, I get this error on compile:
> hello.d:3: Error: identifier 'string' is not defined
> hello.d:3: Error: string is used as a type
> hello.d:3: function hello.main parameters must be main() or
> main(char[][] args)
>
> Is the guy writing the example wrong? Or is it my environment? (gdc
> 0.23, on Mac OSX 10.4)
>
> Thanks,
>
the string alias was added in dmd 1.016 (which btw was a horrible idea imho), and with gdc 0.23 being 1.007 it's not availble, seems like someone was a bit enthusiastic updating the wikipedia pages.
|
August 15, 2007 Re: string not aliased | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jason House | Jason House <jason.james.house@gmail.com> wrote: > The current gdc supports d version 1.x. The example you're doing, I > believe, is for an alpha version of d (version 2.x). const(char) and > various const/final/invariant stuff was added in 2.x (and is the reason > for the version # increase and calling it an alpha release) OK, thanks. Does anyone knows when gdc will have D2.0? Cheers, -- Charles |
August 15, 2007 Re: string not aliased | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Brossollet | Charles Brossollet wrote: >> The current gdc supports d version 1.x. The example you're doing, I >> believe, is for an alpha version of d (version 2.x). const(char) and >> various const/final/invariant stuff was added in 2.x (and is the reason >> for the version # increase and calling it an alpha release) > > OK, thanks. Does anyone knows when gdc will have D2.0? You can get "string" alias before D 2.0, though ? It came in DMD 1.016 and the GDC svn is currently up to DMD 1.020... David Friedman hasn't published any E.T.A. on GDC 2.0 yet. Could be since we haven't reached GDC 1.0 yet, but anyway. :) --anders PS. http://sourceforge.net/svn/?group_id=154306 |
August 16, 2007 Re: string not aliased | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anders F Björklund | Anders F Björklund <afb@algonet.se> wrote: > You can get "string" alias before D 2.0, though ? It came in DMD 1.016 and the GDC svn is currently up to DMD 1.020... > > David Friedman hasn't published any E.T.A. on GDC 2.0 yet. Could be since we haven't reached GDC 1.0 yet, but anyway. :) > > --anders > > PS. http://sourceforge.net/svn/?group_id=154306 Thanks, got svn gdc and it works. Just one thing: gdc --version still says it is synced to DMC 1.007, which is a bit confusing... -- Charles |
August 16, 2007 Re: string not aliased | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Brossollet | Charles Brossollet wrote:
> Thanks, got svn gdc and it works. Just one thing: gdc --version still
> says it is synced to DMC 1.007, which is a bit confusing...
Indeed (that was true for GDC 0.23) It probably just hasn't been updated
yet, but should be before release (was wrong in a previous GDC version*)
You can enter a bug for it in Bugzilla perhaps, unless it's updated soon
Usually one can go off the ChangeLog, where it says "Merge DMD X.YYY"...
--anders
* At least I think this line in my build script was for a reason:
perl -pe 's@using dmd 0.149@using dmd 0.157@' -i d/gdc-version; \
|
Copyright © 1999-2021 by the D Language Foundation