Re: general questions regarding value and reference semantics

2013-04-28 Thread Ali Çehreli
On 04/28/2013 05:22 PM, WhatMeWorry wrote: > Does a fixed-length, static array behave with value semantics Yes, a static array has value semantics. When assigned, a variable of a static array type will get its own elements, separate from the right hand side's elements. int[2] a; int[

Re: general questions regarding value and reference semantics

2013-04-28 Thread evilrat
On Monday, 29 April 2013 at 00:22:23 UTC, WhatMeWorry wrote: I think I understand (and admire) D's use of value semantics for structs and reference semantics for classes. I believe classes exist for the entirety of a program's life whereas structs exist for the lifetime of their scope. struct

general questions regarding value and reference semantics

2013-04-28 Thread WhatMeWorry
I think I understand (and admire) D's use of value semantics for structs and reference semantics for classes. I believe classes exist for the entirety of a program's life whereas structs exist for the lifetime of their scope. So I assume it is illegal for a struct to contain a class? And (hol

Re: does GtkD (win7) support opengl?

2013-04-28 Thread Mike Wey
On 04/28/2013 07:33 PM, Mike Wey wrote: On 04/28/2013 04:08 PM, Alexandr Druzhinin wrote: 28.04.2013 20:26, Mike Wey пишет: On 04/28/2013 01:04 PM, Alexandr Druzhinin wrote: developers version of GtkD solves my problem. but GtkD 2.1.1 from download page doesn't. May be remove it from there to

Re: Can't compile the code

2013-04-28 Thread Maxim Fomin
On Sunday, 28 April 2013 at 18:40:20 UTC, bearophile wrote: Ali Çehreli: The name of the parameter is omitted. Could have named it as 'p': auto f = (bool p = false) {}; OK. But is it syntactically allowed in D to omit the variable name when there is a default argument? I have never seen

Re: Calculation differences between Debug and Release mode

2013-04-28 Thread Ali Çehreli
On 04/28/2013 12:39 PM, Marco Leise wrote: > What worries me is that this jeopardizes the efforts put into > C to make floating point calculations the same under all > circumstances. That is news to me. I remember knowing this problem from C. Perhaps something new in the C standard that I haven

function overrides but is not covariant

2013-04-28 Thread Namespace
That surprised me a bit. Is that expected? import std.stdio; struct A { } interface IFoo { void bar(ref const A); } class Foo : IFoo { void bar(ref const A a) { } void bar(const A a) { return this.bar(a); }

Re: Calculation differences between Debug and Release mode

2013-04-28 Thread Marco Leise
Am Mon, 15 Apr 2013 11:51:43 -0400 schrieb "Steven Schveighoffer" : > On Mon, 15 Apr 2013 11:51:07 -0400, Steven Schveighoffer > wrote: > > > I would suspect that the issue is floating point error. On certain > > hardware, the CPU uses higher-precision 80-bit floating points. When > > yo

Re: How i can clear Associative Arrays

2013-04-28 Thread Marco Leise
Am Mon, 15 Apr 2013 13:06:01 -0400 schrieb "Steven Schveighoffer" : > On Sun, 14 Apr 2013 02:50:07 -0400, gedaiu wrote: > > > On Saturday, 13 April 2013 at 21:10:16 UTC, Nicolas Guillemot wrote: > >>> I think we should introduce a removeAll function for hashes. Either > >>> through Druntime or t

Re: Can't compile the code

2013-04-28 Thread bearophile
Ali Çehreli: The name of the parameter is omitted. Could have named it as 'p': auto f = (bool p = false) {}; OK. But is it syntactically allowed in D to omit the variable name when there is a default argument? I have never seen it before... Bye, bearophile

Re: Can't compile the code

2013-04-28 Thread Ali Çehreli
On 04/28/2013 09:14 AM, bearophile wrote: Temtaime: auto f = (bool = false) {}; I don't understand this syntax. Bye, bearophile The name of the parameter is omitted. Could have named it as 'p': auto f = (bool p = false) {}; Ali

Re: does GtkD (win7) support opengl?

2013-04-28 Thread Mike Wey
On 04/28/2013 04:08 PM, Alexandr Druzhinin wrote: 28.04.2013 20:26, Mike Wey пишет: On 04/28/2013 01:04 PM, Alexandr Druzhinin wrote: developers version of GtkD solves my problem. but GtkD 2.1.1 from download page doesn't. May be remove it from there to avoid such problems? Does it also draw

Re: GtkD "No GSettings schemas installed"

2013-04-28 Thread Mike Wey
On 04/28/2013 04:32 PM, QAston wrote: On Monday, 15 April 2013 at 18:10:00 UTC, Mike Wey wrote: On 04/15/2013 05:45 PM, Josh wrote: On Sunday, 14 April 2013 at 13:34:07 UTC, Mike Wey wrote: So it looks like the shemas are installed properly. You could try running the gsettings app from a dif

Re: Can't compile the code

2013-04-28 Thread bearophile
Temtaime: auto f = (bool = false) {}; I don't understand this syntax. Bye, bearophile

Re: Can't compile the code

2013-04-28 Thread Ali Çehreli
On 04/28/2013 01:53 AM, Temtaime wrote: int main() { auto f = (bool = false) {}; f(); return 0; } I can't compile this code on DMD32 D Compiler v2.062 On windows. It says to me: Error: expected 1 function arguments, not 0 On linux it seems to work(http://ideone.com/

Re: GtkD "No GSettings schemas installed"

2013-04-28 Thread QAston
On Monday, 15 April 2013 at 18:10:00 UTC, Mike Wey wrote: On 04/15/2013 05:45 PM, Josh wrote: On Sunday, 14 April 2013 at 13:34:07 UTC, Mike Wey wrote: So it looks like the shemas are installed properly. You could try running the gsettings app from a different location than where it's locat

Re: does GtkD (win7) support opengl?

2013-04-28 Thread Alexandr Druzhinin
28.04.2013 20:26, Mike Wey пишет: On 04/28/2013 01:04 PM, Alexandr Druzhinin wrote: developers version of GtkD solves my problem. but GtkD 2.1.1 from download page doesn't. May be remove it from there to avoid such problems? Does it also draw the triangle properly for you? yes, it works out o

Re: does GtkD (win7) support opengl?

2013-04-28 Thread Mike Wey
On 04/28/2013 01:04 PM, Alexandr Druzhinin wrote: developers version of GtkD solves my problem. but GtkD 2.1.1 from download page doesn't. May be remove it from there to avoid such problems? Does it also draw the triangle properly for you? -- Mike Wey

Re: how hash_t toHash() works?

2013-04-28 Thread Ivan Kazmenko
Hi, I have a class which I want to use as key in an assoc array like this: string["KeyString"] myArray; What i want is to preserve the order in the array. I want always to have "1" before "2" if the string is a numeric value. Can anyone help me to understand how const hash_t toHash() should

Re: does GtkD (win7) support opengl?

2013-04-28 Thread Alexandr Druzhinin
developers version of GtkD solves my problem. but GtkD 2.1.1 from download page doesn't. May be remove it from there to avoid such problems?

how hash_t toHash() works?

2013-04-28 Thread gedaiu
hi, I have a class which I want to use as key in an assoc array like this: string["KeyString"] myArray; What i want is to preserve the order in the array. I want always to have "1" before "2" if the string is a numeric value. Can anyone help me to understand how const hash_t toHash() should wo

Can't compile the code

2013-04-28 Thread Temtaime
int main() { auto f = (bool = false) {}; f(); return 0; } I can't compile this code on DMD32 D Compiler v2.062 On windows. It says to me: Error: expected 1 function arguments, not 0 On linux it seems to work(http://ideone.com/fsKYWR).

Re: immutable string

2013-04-28 Thread Michael
Why? Because maybe string is already (immutable)char[]? Immutable var itself is runtime constant (as mentioned here - docs are outdated), enum var is manifest constant (can be copypasted at compile time). Now right way is 'enum string' ... or 'str.to!string()' that can be evaluated at compi

Re: Simple delete directory tree?

2013-04-28 Thread Marco Leise
Am Fri, 26 Apr 2013 23:15:20 +0200 schrieb Andrej Mitrovic : > On 4/26/13, Nick Sabalausky wrote: > > I don't know how I managed to overlook that! Thanks :) > > I'd actually prefer if it was an enum or some other default parameter > in the rmdir function itself: > > rmdir(string path, bool doRe

Re: Strange Segfault using XCB bindings from dsource

2013-04-28 Thread Marco Leise
Am Tue, 16 Apr 2013 17:57:55 +0200 schrieb "Mpnordladn" : > Hey all, > I'm poking around D, trying to see if it will be worth my while > to learn it. > I've used XCB in C++ and Python before, and I was delighted to > see that D has an XCB > binding as well. The problem, however, is in the exampl