digitalmars.D.learn - enum string
- Namespace (14/14) Aug 07 2012 [code]
- Dmitry Olshansky (5/18) Aug 07 2012 isSomeString!T regression? See enum & std.traits topic in d.D.
- Namespace (2/23) Aug 07 2012 -.-
- Jonathan M Davis (5/7) Aug 07 2012 Yeah. In 2.060, std.traits doesn't treat enums as their base type for st...
- Namespace (3/12) Aug 08 2012 Which file must i replace with his version from github to solve
- Jonathan M Davis (9/24) Aug 08 2012 I really wouldn't advise grabbing single files like that. The release wa...
- Namespace (4/16) Aug 08 2012 Fails on Win7 with:
- Jonathan M Davis (5/7) Aug 08 2012 I don't remember. Probably because it's stdio.h in C/C++.
- Namespace (2/2) Aug 08 2012 And why ends my compilation with this error?
- Jonathan M Davis (7/9) Aug 08 2012 You're going to need to build both druntime and Phobos if you want to bu...
- Namespace (6/6) Aug 09 2012 Ok. Now I have built both phobos and druntime.
- Jonathan M Davis (11/17) Aug 09 2012 You don't need druntime.lib. You just need to make sure that your sc.ini...
- Jonathan M Davis (4/23) Aug 09 2012 Another option would be to use dvm:
[code] import std.regex; enum Token : string { Blank = r"\s+" } void main() { const string text = "Foo Bar"; // text.split(regex(Token.Blank)); // don't work const string blank = Token.Blank; text.split(regex(blank)); // work } [/code] Can me somebody explain that? o.O
Aug 07 2012
On 07-Aug-12 21:05, Namespace wrote:[code] import std.regex; enum Token : string { Blank = r"\s+" } void main() { const string text = "Foo Bar"; // text.split(regex(Token.Blank)); // don't work const string blank = Token.Blank; text.split(regex(blank)); // work } [/code] Can me somebody explain that? o.OisSomeString!T regression? See enum & std.traits topic in d.D. Seems like it will work again in 2.061... -- Dmitry Olshansky
Aug 07 2012
On Tuesday, 7 August 2012 at 17:14:03 UTC, Dmitry Olshansky wrote:On 07-Aug-12 21:05, Namespace wrote:-.-[code] import std.regex; enum Token : string { Blank = r"\s+" } void main() { const string text = "Foo Bar"; // text.split(regex(Token.Blank)); // don't work const string blank = Token.Blank; text.split(regex(blank)); // work } [/code] Can me somebody explain that? o.OisSomeString!T regression? See enum & std.traits topic in d.D. Seems like it will work again in 2.061...
Aug 07 2012
On Tuesday, August 07, 2012 21:14:00 Dmitry Olshansky wrote:isSomeString!T regression? See enum & std.traits topic in d.D. Seems like it will work again in 2.061...Yeah. In 2.060, std.traits doesn't treat enums as their base type for stuff like isSomeString and isIntegral, which is the problem. It's been fixed on github, but it's still broken in 2.060. - Jonathan M Davis
Aug 07 2012
On Tuesday, 7 August 2012 at 18:31:41 UTC, Jonathan M Davis wrote:On Tuesday, August 07, 2012 21:14:00 Dmitry Olshansky wrote:Which file must i replace with his version from github to solve the problem?isSomeString!T regression? See enum & std.traits topic in d.D. Seems like it will work again in 2.061...Yeah. In 2.060, std.traits doesn't treat enums as their base type for stuff like isSomeString and isIntegral, which is the problem. It's been fixed on github, but it's still broken in 2.060. - Jonathan M Davis
Aug 08 2012
On Wednesday, August 08, 2012 17:58:17 Namespace wrote:On Tuesday, 7 August 2012 at 18:31:41 UTC, Jonathan M Davis wrote:I really wouldn't advise grabbing single files like that. The release was recent enough that it may be okay, but in general, that's just asking for trouble - especially with something as integral as std.traits. But if you really want to, this is the relevant pull request: https://github.com/D-Programming-Language/phobos/pull/739 std.conv, std.format, std.stdio, and std.traits were all changed as part of the fix. - Jonathan M DavisOn Tuesday, August 07, 2012 21:14:00 Dmitry Olshansky wrote:Which file must i replace with his version from github to solve the problem?isSomeString!T regression? See enum & std.traits topic in d.D. Seems like it will work again in 2.061...Yeah. In 2.060, std.traits doesn't treat enums as their base type for stuff like isSomeString and isIntegral, which is the problem. It's been fixed on github, but it's still broken in 2.060. - Jonathan M Davis
Aug 08 2012
I really wouldn't advise grabbing single files like that. The release was recent enough that it may be okay, but in general, that's just asking for trouble - especially with something as integral as std.traits. But if you really want to, this is the relevant pull request: https://github.com/D-Programming-Language/phobos/pull/739 std.conv, std.format, std.stdio, and std.traits were all changed as part of the fix. - Jonathan M DavisFails on Win7 with: Error: don't know how to make '..\druntime\lib\druntime.lib' Quick question: I've asked that for some time: why is it std.stdio and not std.io?
Aug 08 2012
On Wednesday, August 08, 2012 21:21:38 Namespace wrote:Quick question: I've asked that for some time: why is it std.stdio and not std.io?I don't remember. Probably because it's stdio.h in C/C++. But Steven Schveighoffer is working on a replacement for it which will probably be named std.io. So, in the long run, that's probably what we'll end up with. - Jonathan M Davis
Aug 08 2012
And why ends my compilation with this error? To cast any Token is _very_ annoying. -.-
Aug 08 2012
On Thursday, August 09, 2012 01:21:29 Namespace wrote:And why ends my compilation with this error?You're going to need to build both druntime and Phobos if you want to build Phobos. I don't know what's in the zip file, since I haven't used it in ages, so I don't know if you can build them from what's in there or whether you need to actually grab them from github.To cast any Token is _very_ annoying. -.-I have no idea what you're talking about. - Jonathan M Davis
Aug 08 2012
Ok. Now I have built both phobos and druntime. Then I have packed the generated phobos.lib in the windows> lib. Now I still have in druntime a new folder "lib" with a druntime.lib in it. What should I do with this? And must I also build dmd anew?
Aug 09 2012
On Thursday, August 09, 2012 10:43:15 Namespace wrote:Ok. Now I have built both phobos and druntime. Then I have packed the generated phobos.lib in the windows> lib. Now I still have in druntime a new folder "lib" with a druntime.lib in it. What should I do with this?You don't need druntime.lib. You just need to make sure that your sc.ini points to the right import paths for the source and library paths for phobos.lib. If you copy phobos.lib to where the one from 2.060 is and copy the source over to where the source is for 2.060, then you should be fine without doing anything to sc.ini. But if you don't want to replace any of that, then you need to point sc.ini at the place where the new stuff is.And must I also build dmd anew?Probably not given how recent the release was. Certainly, if everything built fine with dmd 2.060, then you should be fine, but in general, if you want to build the latest druntime or Phobos, you need the latest dmd. - Jonathan M Davis
Aug 09 2012
On Thursday, August 09, 2012 01:51:43 Jonathan M Davis wrote:On Thursday, August 09, 2012 10:43:15 Namespace wrote:Another option would be to use dvm: https://bitbucket.org/doob/dvm/wiki/Home - Jonathan M DavisOk. Now I have built both phobos and druntime. Then I have packed the generated phobos.lib in the windows> lib. Now I still have in druntime a new folder "lib" with a druntime.lib in it. What should I do with this?You don't need druntime.lib. You just need to make sure that your sc.ini points to the right import paths for the source and library paths for phobos.lib. If you copy phobos.lib to where the one from 2.060 is and copy the source over to where the source is for 2.060, then you should be fine without doing anything to sc.ini. But if you don't want to replace any of that, then you need to point sc.ini at the place where the new stuff is.And must I also build dmd anew?Probably not given how recent the release was. Certainly, if everything built fine with dmd 2.060, then you should be fine, but in general, if you want to build the latest druntime or Phobos, you need the latest dmd.
Aug 09 2012