Re: [Question] About mixin, template and alias

2013-09-23 Thread monarch_dodra
On Monday, 23 September 2013 at 06:31:01 UTC, monarch_dodra wrote: I'm filing a bug report right now. http://d.puremagic.com/issues/show_bug.cgi?id=11107

Re: Regression or bugfix?

2013-09-23 Thread Jacob Carlborg
On 2013-09-22 15:49, simendsjo wrote: In 2.063.2, (T!int).stringof == T!(int). In current head, it's T!int. Even (T!(int)).stringof == T!int. So is this a regression bug or a bugfix? Apparently you shouldn't rely on the format of .stringof. See the comment the ones that follow:

Re: Multiline String Literals without linefeeds?

2013-09-23 Thread bearophile
John Carter: is there a similar mechanism in D? Or should I do... string foo = long string without linefeeds ; Genrally you should do: string foo = long ~ string ~ without ~ linefeeds; See also: http://d.puremagic.com/issues/show_bug.cgi?id=3827 You

Re: Multiline String Literals without linefeeds?

2013-09-23 Thread simendsjo
On Monday, 23 September 2013 at 09:42:59 UTC, bearophile wrote: John Carter: is there a similar mechanism in D? Or should I do... string foo = long string without linefeeds ; Genrally you should do: string foo = long ~ string ~ without ~ linefeeds;

Re: User defined attributes use

2013-09-23 Thread simendsjo
On Monday, 23 September 2013 at 07:47:32 UTC, Jacob Carlborg wrote: On 2013-09-20 16:12, simendsjo wrote: You could of course fix this in a library too. enum AttributeUsage { struct_ = 1 0, class_ = 1 1, //etc } struct attribute { AttributeUsage usage; } Then the library could give

Re: Multiline String Literals without linefeeds?

2013-09-23 Thread bearophile
simendsjo: Isn't some string replaced with somestring early on? Yes, unfortunately. And it's something Walter agreed with me to kill, but nothing has happened... Bye, bearophile

Re: Multiline String Literals without linefeeds?

2013-09-23 Thread Dicebot
On Monday, 23 September 2013 at 11:10:07 UTC, bearophile wrote: simendsjo: Isn't some string replaced with somestring early on? Yes, unfortunately. And it's something Walter agreed with me to kill, but nothing has happened... Bye, bearophile Rationale / link to discussion? I use it

Re: Multiline String Literals without linefeeds?

2013-09-23 Thread bearophile
Dicebot: Rationale / link to discussion? I use it extensively. http://d.puremagic.com/issues/show_bug.cgi?id=3827 Bye, bearophile

Re: const and immutable members

2013-09-23 Thread Daniel Davidson
On Monday, 23 September 2013 at 03:51:41 UTC, Jonathan M Davis wrote: Doesn't using immutable there present the same problem as with the slice? S is no longer assignable. But who would recommend not using immutable in this case if you want aarr to be stable. If you do not use immutable then

Re: cast(immutable) vs extra variable

2013-09-23 Thread Daniel Davidson
On Sunday, 22 September 2013 at 17:26:01 UTC, Ali Çehreli wrote: You are not alone. I tried to answer some of these questions in my DConf 2013 talk. I think I have only scratched the surface: http://dconf.org/talks/cehreli.html Ali Ali, thank you for providing great feedback and

Re: cast(immutable) vs extra variable

2013-09-23 Thread Ali Çehreli
On 09/23/2013 06:34 AM, Daniel Davidson wrote: I've stepped away from D for several months and just getting back into it. the first time at D Conf Actually, I've been thinking about you recently. My apologies for forgetting your last name. That's why I couldn't recognize you. :( I will

Trouble with destroy

2013-09-23 Thread Namespace
Code: import std.stdio; struct A { public: int[4] val; alias val this; } void main() { A a; a.destroy(); } /d824/f630.d(13): Error: template object.destroy matches more than one template declaration,

Re: Trouble with destroy

2013-09-23 Thread Namespace
On Monday, 23 September 2013 at 19:06:48 UTC, Namespace wrote: Code: import std.stdio; struct A { public: int[4] val; alias val this; } void main() { A a; a.destroy(); } /d824/f630.d(13): Error: template object.destroy matches more than one

Re: [Question] About mixin, template and alias

2013-09-23 Thread Michael
I understand. So, at least it's has interesting behaviour and big question)

In what state of DIP23?

2013-09-23 Thread Michael
by subject) Read properties with the @property annotation Applying the () to a property will simply apply it to the result of the property. THIS IS A CHANGE OF BEHAVIOR. unittest { @property int function() prop1() { return () = 42; } assert(prop1() == 42); } What is about this part?

Re: [Question] About mixin, template and alias

2013-09-23 Thread Michael
Code below shows that I would achieve: / fire.d alias void delegate() EventHandler; class Event(T) { private T[] _events; public void opOpAssign(string op)(T param) if (op == ~) { _events ~= param; } public void opCall(ParamType ...)(ParamType params) {

Re: Unable to use tradional tools to find memory leaks

2013-09-23 Thread Flamaros
On Saturday, 21 September 2013 at 14:30:19 UTC, Flamaros wrote: I tried to used Valgrind (Linux) and Dr Memory (Windows) without success to find a big leak I have in my application. But both tools can't launch my application without make it crash. Do I need do something particular, to have a

Re: Unable to use tradional tools to find memory leaks

2013-09-23 Thread Flamaros
On Monday, 23 September 2013 at 20:06:20 UTC, Flamaros wrote: On Saturday, 21 September 2013 at 14:30:19 UTC, Flamaros wrote: I tried to used Valgrind (Linux) and Dr Memory (Windows) without success to find a big leak I have in my application. But both tools can't launch my application without

Re: Unable to use tradional tools to find memory leaks

2013-09-23 Thread Flamaros
On Monday, 23 September 2013 at 21:35:21 UTC, Flamaros wrote: On Monday, 23 September 2013 at 20:06:20 UTC, Flamaros wrote: On Saturday, 21 September 2013 at 14:30:19 UTC, Flamaros wrote: I tried to used Valgrind (Linux) and Dr Memory (Windows) without success to find a big leak I have in my

Re: const and immutable members

2013-09-23 Thread Jonathan M Davis
On Monday, September 23, 2013 13:49:59 Daniel Davidson wrote: But if your concern is client code messing with your member variable, then don't give them access to it in the first place. Not quite as much messing with the member as messing with what it points to. In the setup - rich data,

Re: Unable to use tradional tools to find memory leaks

2013-09-23 Thread growler
Might be related to or even the same issue reported here: http://forum.dlang.org/thread/bug-1005...@http.d.puremagic.com/issues/ This is a Valgrind issue though and not DMD related.

Re: Trouble with destroy

2013-09-23 Thread Meta
On Monday, 23 September 2013 at 19:11:53 UTC, Namespace wrote: As always. As soon as you wrote it, you've got the solution. destroy!A(a); This still seems like it should be worth reporting. I can't remember... Is partial ordering done between multiple matching template functions

Re: Trouble with destroy

2013-09-23 Thread Jonathan M Davis
On Monday, September 23, 2013 22:45:33 H. S. Teoh wrote: On Tue, Sep 24, 2013 at 05:18:38AM +0200, Meta wrote: On Monday, 23 September 2013 at 19:11:53 UTC, Namespace wrote: As always. As soon as you wrote it, you've got the solution. destroy!A(a); This still seems like