Re: hiding a class property behind a method

2014-02-23 Thread luka8088
On 23.2.2014. 13:51, luka8088 wrote: > That is exactly what I wanted to point out! I reduced the example code > to make that point more obvious: Just one note. I know how this works currently in D and how it works in C++. What I am asking here is not how it works but is this a good idea as

Re: hiding a class property behind a method

2014-02-23 Thread luka8088
On 22.2.2014. 23:43, simendsjo wrote: > On 02/22/2014 11:33 PM, Francesco Cattoglio wrote: > The problem isn't about optional parenthesis or properties. It's the > fact that > you can redefine a symbol to be something entierly different, and that this > difference will only be seen if you are looki

hiding a class property behind a method

2014-02-22 Thread luka8088
It seems to me that the following code should be illegal, but I am uncertain of it so I am posting here for a confirmation before I post it on bug tracker: http://dpaste.dzfl.pl/dae728734cc6 import std.stdio; class A { string x () { return "A"; }; } class B : A { override string x () { re

Re: Overflow-safe use of unsigned integral types

2013-11-10 Thread luka8088
On 10.11.2013. 12:10, Joseph Rushton Wakeling wrote: > One of the challenges when working with unsigned types is that automatic > wraparound and implicit conversion can combine to unpleasant effect. > > Consider e.g.: > > void foo(ulong n) > { > writeln(n); > } > > void m

Re: Is -1 > 7 ?

2013-08-14 Thread luka8088
On 9.8.2013. 17:11, michaelc37 wrote: forgive me if i'm doing something stupid, i'm extremely tired and trying to avoid drinking coffee. void main() { int[] arr = [0, 1, 2, 3, 4, 5, 6]; //check 1 if (-1 > arr.length) writefln("WTF -> %d is greater than %d ", -1, arr.length); else writefln("

Re: current GC behavior

2012-11-06 Thread luka8088
On 6.11.2012 21:59, Ali Çehreli wrote: On 11/06/2012 12:00 PM, luka8088 wrote: > Yes, but it seems that we can in general say that the following code > will never fail... or am I wrong ? > > import core.memory; > > class a { > static int totalRefCount = 0; >

Re: current GC behavior

2012-11-06 Thread luka8088
On 6.11.2012 18:02, thedeemon wrote: On Tuesday, 6 November 2012 at 11:27:25 UTC, luka8088 wrote: Hello everyone, I was writing some unit tests and I also wanted to test that in certain cases object references are properly removed everywhere so that GC can collect them in order to make sure

Re: current GC behavior

2012-11-06 Thread luka8088
On 6.11.2012 18:00, Ali Çehreli wrote: On 11/06/2012 03:27 AM, luka8088 wrote: > I was writing some unit tests and I also wanted to test that in certain > cases object references are properly removed everywhere so that GC can > collect them in order to make sure there is no me

current GC behavior

2012-11-06 Thread luka8088
Hello everyone, I was writing some unit tests and I also wanted to test that in certain cases object references are properly removed everywhere so that GC can collect them in order to make sure there is no memory leak. While trying to achieve this I learned that objects are not always collecte

unsynchronized access to primitive variables

2012-05-19 Thread luka8088
Hello to all, I would like to know if D guarantees that access to primitive variable is atomic ? I was looking for any source of information that says anything about unsynchronized access to primitive variables. What I want to know is if it is possible (in any way and any OS / hardware) for