Re: Get current date and time with std.datetime

2011-10-07 Thread Joel Christensen
http://d-programming-language.org/intro-to-datetime.html Thanks Jonathan, that helped I think, (haven't read it all, though). But I've got errors with some of the date times not being able to change them with int's values. task.d(44): Error: function std.datetime.DateTime.month () const is

polymorphic call from variant?

2011-10-07 Thread Mariusz Gliwiński
Hey, i had almost no problem in d-coding since i deferred creation of my messaging system. Although, i can't do that anymore - so, remembering what you told me, my expectations are much smaller now. This time i'd like to make 'basic' version, but STILL wasting hours on that o,o. OK, so one most

contrary of std.utf.toUTFz!(const(wchar)*)

2011-10-07 Thread Paolo Invernizzi
Hi all, I feel a little stupid, but how to convert a wchar* zero terminated string into a wstring (DMD 2.055)? I'm digging into Phobos, but right now I've found no way... Thanks, Paolo

Re: contrary of std.utf.toUTFz!(const(wchar)*)

2011-10-07 Thread Christophe
Paolo Invernizzi , dans le message (digitalmars.D.learn:29974), a écrit : > Hi all, > > I feel a little stupid, but how to convert a wchar* zero terminated string > into a wstring (DMD 2.055)? > I'm digging into Phobos, but right now I've found no way... > > Thanks, Paolo. std.conv.to!wstring

Re: Stack Overflow error missing

2011-10-07 Thread bearophile
Andrej Mitrovic: > I'm fairly sure this used to give me a stack overflow error: It's a regression: http://d.puremagic.com/issues/show_bug.cgi?id=6088 Bye, bearophile

Re: Get current date and time with std.datetime

2011-10-07 Thread Jacob Carlborg
On 2011-10-07 08:54, Jonathan M Davis wrote: On Thursday, October 06, 2011 23:31:26 Jonathan M Davis wrote: On Friday, October 07, 2011 08:23:10 Jacob Carlborg wrote: On 2011-10-07 08:15, Jonathan M Davis wrote: On Friday, October 07, 2011 19:08:33 Joel Christensen wrote: Hi, I have a progra

Re: contrary of std.utf.toUTFz!(const(wchar)*)

2011-10-07 Thread Trass3r
I feel a little stupid, but how to convert a wchar* zero terminated string into a wstring (DMD 2.055)? wstring w = cstr[0 .. strlenw(cstr)];

Re: contrary of std.utf.toUTFz!(const(wchar)*)

2011-10-07 Thread Christophe
Trass3r , dans le message (digitalmars.D.learn:29978), a écrit : >> I feel a little stupid, but how to convert a wchar* zero terminated >> string into a wstring (DMD 2.055)? > > wstring w = cstr[0 .. strlenw(cstr)]; if cstr comes from c code, you cannot guarantee it is immutable. Moreover, cs

Re: contrary of std.utf.toUTFz!(const(wchar)*)

2011-10-07 Thread Trass3r
Just wanted to point out how it's implemented with language tools.

Order of base-class constructor calls

2011-10-07 Thread Andrej Mitrovic
Is there any way to enforce the user to call the base-class ctor via super(), so it's the first statement in his class ctor? e.g.: class Base { this(int) { } } class Derived : Base { this(int x) { super(x); // user statements } } The problem I'm having is that Base do

Re: Simple I know, but could use some help compiling with make

2011-10-07 Thread Roderick Gibson
On 10/5/2011 7:46 AM, Ola Ost wrote: I had exactly this problem too, I asked on the Derelict forums: http://www.dsource.org/forums/viewtopic.php?t=5856&sid=8ebff671fafec3bd8962ddfceaf99eb8 At the moment I've resolved this by building Derelict with make, first a normal full build, then a second

Is there a way to set an alias to specific form of a template?

2011-10-07 Thread Roderick Gibson
This may be the completely wrong approach, but I am basically thinking of something like this (I am aware this will not compile, it's psuedocode): class Vector(T) { ... //definition here } alias Vector(float, float) vec2f; auto v = new vec2f(1.0,1.0); I am making a templated Vector cla

Re: Is there a way to set an alias to specific form of a template?

2011-10-07 Thread Andrej Mitrovic
You don't have to rewrite Vector for multiple dimensions, methinks: class Vector(T...) { this(T t) {} } void main() { alias Vector!(float, float) vec2f; auto v = new vec2f(1.0,1.0); } You'll probably have to play with `static if`, template constraints, and stuff like that.

Re: Is there a way to set an alias to specific form of a template?

2011-10-07 Thread Andrej Mitrovic
There's an LGPL-licensed Vector module here: https://github.com/Zardoz89/zmath/blob/master/src/vector.d Not mine, but it's interesting.

Re: Is there a way to set an alias to specific form of a template?

2011-10-07 Thread Roderick Gibson
On 10/7/2011 7:37 PM, Andrej Mitrovic wrote: There's an LGPL-licensed Vector module here: https://github.com/Zardoz89/zmath/blob/master/src/vector.d Not mine, but it's interesting. Awesome, thanks for both answers. I figured there was already an implementation, this is mostly just to play wit

Re: Simple I know, but could use some help compiling with make

2011-10-07 Thread Nick Sabalausky
"Ola Ost" wrote in message news:j6hqkh$lk0$1...@digitalmars.com... >I had exactly this problem too, I asked on the Derelict forums: > http://www.dsource.org/forums/viewtopic.php?t=5856&sid=8ebff671fafec3bd8962ddfceaf99eb8 > > At the moment I've resolved this by building Derelict with make, first

Re: Is there a way to set an alias to specific form of a template?

2011-10-07 Thread Ali Çehreli
On Fri, 07 Oct 2011 18:29:26 -0700, Roderick Gibson wrote: > This may be the completely wrong approach, but I am basically thinking > of something like this (I am aware this will not compile, it's > psuedocode): > > class Vector(T) { > ... //definition here > } > > alias Vector(float, floa

Re: Is there a way to set an alias to specific form of a template?

2011-10-07 Thread Roderick Gibson
On 10/7/2011 7:33 PM, Andrej Mitrovic wrote: You don't have to rewrite Vector for multiple dimensions, methinks: class Vector(T...) { this(T t) {} } void main() { alias Vector!(float, float) vec2f; auto v = new vec2f(1.0,1.0); } You'll probably have to play with `static if`, tem