digitalmars.D.learn - string not aliased
- chbrosso free.fr (Charles Brossollet) (14/14) Aug 15 2007 Hi all,
- Regan Heath (9/24) Aug 15 2007 The string alias was added in DMD 1.016:
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (3/10) Aug 15 2007 GDC 0.23 is based on DMD 1.007, see http://gdcmac.sf.net
- Regan Heath (6/17) Aug 15 2007 Ahh, thanks.
- chbrosso free.fr (Charles Brossollet) (5/32) Aug 15 2007 GDC 0.23 is based on DMD 1.007, so that explains my problem.
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (5/18) Aug 15 2007 The example is using D 2.0, while GDC supports D 1.0 at the moment.
- Regan Heath (4/24) Aug 15 2007 Technically I guess it's D 1.016 or D 2.0 code. Am I correct about
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (7/14) Aug 15 2007 You are right, it'll probably be fixed in GDC 0.24 then. (DMD 1.018)
- Witold Baryluk (12/27) Aug 15 2007 This is example of D 2, code. Who the hell published this on Wikipedia?
- Carlos Santander (7/25) Aug 15 2007 string was added in DMD 1.016, which corresponds to GDC SVN revision 134...
- Tomas Lindquist Olsen (4/22) Aug 15 2007 the string alias was added in dmd 1.016 (which btw was a horrible idea
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, -- Charles
Aug 15 2007
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 string alias was added in DMD 1.016: http://www.digitalmars.com/d/1.0/changelog.html#new1_016 GDC 0.21 was based on DMD 1.000, but I have no idea what GDC 0.23 is based on as I cannot see that info on the GDC page. I suspect it's still based on DMD 1.000 and therefore has no aliases. However, the aliases are defined in phobos and I suspect if you grab the latest phobos source and build it you will solve your problem. Regan
Aug 15 2007
Regan Heath wrote:The string alias was added in DMD 1.016: http://www.digitalmars.com/d/1.0/changelog.html#new1_016 GDC 0.21 was based on DMD 1.000, but I have no idea what GDC 0.23 is based on as I cannot see that info on the GDC page. I suspect it's still based on DMD 1.000 and therefore has no aliases.GDC 0.23 is based on DMD 1.007, see http://gdcmac.sf.net --anders
Aug 15 2007
Anders F Björklund wrote:Regan Heath wrote:Ahh, thanks. I was looking here: http://dgcc.sourceforge.net/#doc I saw the link to gdcmac and gdcwin but I didn't follow them. ReganThe string alias was added in DMD 1.016: http://www.digitalmars.com/d/1.0/changelog.html#new1_016 GDC 0.21 was based on DMD 1.000, but I have no idea what GDC 0.23 is based on as I cannot see that info on the GDC page. I suspect it's still based on DMD 1.000 and therefore has no aliases.GDC 0.23 is based on DMD 1.007, see http://gdcmac.sf.net
Aug 15 2007
Regan Heath <regan netmail.co.nz> wrote:Charles Brossollet wrote:GDC 0.23 is based on DMD 1.007, so that explains my problem. Thank you very much, -- CharlesHi 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 string alias was added in DMD 1.016: http://www.digitalmars.com/d/1.0/changelog.html#new1_016 GDC 0.21 was based on DMD 1.000, but I have no idea what GDC 0.23 is based on as I cannot see that info on the GDC page. I suspect it's still based on DMD 1.000 and therefore has no aliases. However, the aliases are defined in phobos and I suspect if you grab the latest phobos source and build it you will solve your problem.
Aug 15 2007
Charles Brossollet wrote: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 example is using D 2.0, while GDC supports D 1.0 at the moment. (the language was split into two different versions a while ago...) int main(char[][] args) --anders
Aug 15 2007
Anders F Björklund wrote:Charles Brossollet wrote:Technically I guess it's D 1.016 or D 2.0 code. Am I correct about rebuilding phobos (in my reply to the OP) or will that fail utterly? ReganI'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 example is using D 2.0, while GDC supports D 1.0 at the moment. (the language was split into two different versions a while ago...) int main(char[][] args)
Aug 15 2007
Regan Heath wrote:You are right, it'll probably be fixed in GDC 0.24 then. (DMD 1.018) The aliases can probably be added to the object.d manually meanwhile alias char[] string; alias wchar[] wstring; alias dchar[] dstring; --andersThe example is using D 2.0, while GDC supports D 1.0 at the moment. (the language was split into two different versions a while ago...) int main(char[][] args)Technically I guess it's D 1.016 or D 2.0 code. Am I correct about rebuilding phobos (in my reply to the OP) or will that fail utterly?
Aug 15 2007
Dnia Wed, 15 Aug 2007 18:24:19 +0200 chbrosso free.fr (Charles Brossollet) napisa=B3/a:Hi all, =20 I'm a complete newbie to D, and tried the examples on the Wikipedia page. the example 2 shows a main function like this: =20 int main(string[] args) // string is a type alias for const(char)[] =20 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) =20 Is the guy writing the example wrong? Or is it my environment? (gdc 0.23, on Mac OSX 10.4)This is example of D 2, code. Who the hell published this on Wikipedia? use: int main(char[][] args) { ... } or put "alias char[] string;" before main --=20 Witold Baryluk MAIL: baryluk smp.if.uj.edu.pl, baryluk mpi.int.pl JID: movax jabber.autocom.pl
Aug 15 2007
Charles Brossollet escribió: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,string was added in DMD 1.016, which corresponds to GDC SVN revision 134. GDC 0.23 is only up to DMD 1.007, so get the latest GDC. You can find instructions in http://dsource.org/projects/tango/wiki/UnixInstallGdc, down to the "GDC Installation from source" section. -- Carlos Santander Bernal
Aug 15 2007
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.
Aug 15 2007