Re: Do constructors in D support the privacy keyword?

2013-09-07 Thread Michael
In same module "private" acts like "friend" in C++.

Re: Adding libraries to an executable

2013-09-07 Thread Rikki Cattermole
On Saturday, 7 September 2013 at 13:39:49 UTC, Anton Alexeev wrote: On Saturday, 7 September 2013 at 10:13:39 UTC, Rikki Cattermole wrote: On Saturday, 7 September 2013 at 09:05:39 UTC, Rikki Cattermole wrote: On Friday, 6 September 2013 at 21:31:59 UTC, Anton Alexeev wrote: I've written a prog

Re: Do constructors in D support the privacy keyword?

2013-09-07 Thread Gary Willoughby
On Saturday, 7 September 2013 at 18:49:43 UTC, H. S. Teoh wrote: On Sat, Sep 07, 2013 at 08:37:05PM +0200, Gary Willoughby wrote: Do constructors in D support a privacy keyword? I'm guessing not because if i declare one like this: class T { private this() { } } i can still instant

Re: Do constructors in D support the privacy keyword?

2013-09-07 Thread anonymous
On Saturday, 7 September 2013 at 18:37:11 UTC, Gary Willoughby wrote: Do constructors in D support a privacy keyword? I'm guessing not because if i declare one like this: class T { private this() { } } i can still instantiate the class like this: auto x = new T(); and there is no

Re: Do constructors in D support the privacy keyword?

2013-09-07 Thread H. S. Teoh
On Sat, Sep 07, 2013 at 08:37:05PM +0200, Gary Willoughby wrote: > Do constructors in D support a privacy keyword? I'm guessing not > because if i declare one like this: > > class T > { > private this() > { > } > } > > i can still instantiate the class like this: > > auto x = new T()

Do constructors in D support the privacy keyword?

2013-09-07 Thread Gary Willoughby
Do constructors in D support a privacy keyword? I'm guessing not because if i declare one like this: class T { private this() { } } i can still instantiate the class like this: auto x = new T(); and there is no error thrown. Am i right in thinking the privacy keyword is ignored?

Re: Tools for building a dynamic derived type? I need a push in the right direction.

2013-09-07 Thread Gary Willoughby
On Wednesday, 21 August 2013 at 03:37:46 UTC, Kapps wrote: On Tuesday, 20 August 2013 at 18:55:44 UTC, Gary Willoughby wrote: I've been researching ways to accomplish creating a template that creates a special kind of derived type and i think i need a push in the right direction. Take this simp

Re: Using traits how do i get a function's parameters as a string?

2013-09-07 Thread Gary Willoughby
Thanks all! :)

Re: nothrow function to tell if a string can be converted to a number?

2013-09-07 Thread H. S. Teoh
On Sat, Sep 07, 2013 at 02:00:52AM -0400, Jonathan M Davis wrote: > On Friday, September 06, 2013 22:38:20 H. S. Teoh wrote: > > On Sat, Sep 07, 2013 at 12:38:58AM -0400, Jonathan M Davis wrote: [...] > > > http://d.puremagic.com/issues/show_bug.cgi?id=6840 > > > http://d.puremagic.com/issues/show_

Bug with multiple subtyping?

2013-09-07 Thread Joseph Rushton Wakeling
Hello all, TDPL gives a description in Section 6.13 (pp. 230-233) of a method for subtyping by storing a private instance of the base type and using "alias ... this" to access its methods. The example given is as follows: class StorableShape : Shape { private DBObject _store; alias _

Re: Examples of Windows services in D?

2013-09-07 Thread HeiHon
On Thursday, 23 February 2012 at 01:33:10 UTC, DNewbie wrote: Here is a simple service in D http://my.opera.com/run3/blog/2012/02/23/windows-services-in-d It's basically c translated to d. This example seems to have 404ed. Is there an example of a simple service written in D2 somewhere? I ha

Re: Adding libraries to an executable

2013-09-07 Thread Anton Alexeev
On Saturday, 7 September 2013 at 10:13:39 UTC, Rikki Cattermole wrote: On Saturday, 7 September 2013 at 09:05:39 UTC, Rikki Cattermole wrote: On Friday, 6 September 2013 at 21:31:59 UTC, Anton Alexeev wrote: I've written a program which uses curl library. So on a PC without curl the program wil

Re: Adding libraries to an executable

2013-09-07 Thread Anton Alexeev
On Friday, 6 September 2013 at 22:31:52 UTC, Jonathan M Davis wrote: On Friday, September 06, 2013 23:31:57 Anton Alexeev wrote: I've written a program which uses curl library. So on a PC without curl the program will not work until you install the library. Is there a way to put the curl library

Re: Non-covariance and overrides

2013-09-07 Thread Joseph Rushton Wakeling
On 02/09/13 17:00, Joseph Rushton Wakeling wrote: Is there any way to deal with this situation and simply insist that the subclass's function definition replaces the base class's? I'm sure I remember reading about some way to do this -- to completely replace a base class' method rather than ov

Re: Non-covariance and overrides

2013-09-07 Thread Joseph Rushton Wakeling
On 03/09/13 08:56, Jacob Carlborg wrote: class MyFakeSubclass { MyBaseClass base alias base this; } Every method not available in MyFakeSubclass will be forwarded to "base". http://dlang.org/class.html#AliasThis OK, but the challenge of that approach is that base has to be public, n

Re: nothrow function to tell if a string can be converted to a number?

2013-09-07 Thread Dmitry Olshansky
07-Sep-2013 09:38, H. S. Teoh пишет: On Sat, Sep 07, 2013 at 12:38:58AM -0400, Jonathan M Davis wrote: On Friday, September 06, 2013 21:15:44 Timothee Cour wrote: I'd like to have a function: @nothrow bool isNumberLitteral(string a); unittest{ assert(isNumberLitteral("1.2")); assert(!isNumberL

Re: Adding libraries to an executable

2013-09-07 Thread Rikki Cattermole
On Saturday, 7 September 2013 at 09:05:39 UTC, Rikki Cattermole wrote: On Friday, 6 September 2013 at 21:31:59 UTC, Anton Alexeev wrote: I've written a program which uses curl library. So on a PC without curl the program will not work until you install the library. Is there a way to put the cur

Re: Adding libraries to an executable

2013-09-07 Thread Rikki Cattermole
On Friday, 6 September 2013 at 21:31:59 UTC, Anton Alexeev wrote: I've written a program which uses curl library. So on a PC without curl the program will not work until you install the library. Is there a way to put the curl library in the executable? You just gave me an idea to compile in s

Re: How would I sort an associative array by value?

2013-09-07 Thread Ludovit Lucenic
On Friday, 6 September 2013 at 16:57:09 UTC, H. S. Teoh wrote: You mean you want to sort the stats.keys by the values they are mapped to? Yes, this exactly I wanted to do. What about: import std.array, std.algorithm, std.stdio, std.typecons; // I don't know what your