Re: D2 questions

2010-11-05 Thread Lars T. Kyllingstad
On Fri, 05 Nov 2010 00:00:53 -0400, ponce wrote: > In D2: > > 1. Is A!T implicitely convertible to A!(const(T)) ? That depends on A. // yes template A(T) { alias T[] A; } // no struct A(T) { T t; } > 2. Is A!(immutable(T)) implicitely convertible to A!(const(T)) ? > > 3. Is A!(immuta

just stop program

2010-11-05 Thread spir
Hello, Is there a way for a program to simply exit before end of main()? An instruction like exit, quit, end, halt, stop... [assert(false) is not why I'm looking for, as (1) the compiler protests if there is unreachable code (2) it throws in non-release mode. I just want the program to stop, b

Re: just stop program

2010-11-05 Thread div0
On 05/11/2010 09:32, spir wrote: Hello, Is there a way for a program to simply exit before end of main()? An instruction like exit, quit, end, halt, stop... [assert(false) is not why I'm looking for, as (1) the compiler protests if there is unreachable code (2) it throws in non-release mode.

subclass instance construction

2010-11-05 Thread spir
Hello, I have a weird bug related to class instance construction. My guess is that it seems a superclass's this() is implicitely called (before the subclass's one, if any), even if overriden and without any use of "super". In my case, I have schematically: === super class === this() {

Re: D2 questions

2010-11-05 Thread ponce
Thanks Lars. Makes sense. I included redundant questions to make sure you're not a bot. :)

Re: just stop program

2010-11-05 Thread Lars T. Kyllingstad
On Fri, 05 Nov 2010 09:47:37 +, div0 wrote: > On 05/11/2010 09:32, spir wrote: >> Hello, >> >> Is there a way for a program to simply exit before end of main()? An >> instruction like exit, quit, end, halt, stop... >> >> [assert(false) is not why I'm looking for, as (1) the compiler protests >

Re: subclass instance construction

2010-11-05 Thread Lars T. Kyllingstad
On Fri, 05 Nov 2010 10:54:11 +0100, spir wrote: > Hello, > > > I have a weird bug related to class instance construction. My guess is > that it seems a superclass's this() is implicitely called (before the > subclass's one, if any), even if overriden and without any use of > "super". In my case,

Re: just stop program

2010-11-05 Thread spir
On Fri, 05 Nov 2010 09:47:37 + div0 wrote: > On 05/11/2010 09:32, spir wrote: > > Hello, > > > > Is there a way for a program to simply exit before end of main()? An > > instruction like exit, quit, end, halt, stop... > > > > [assert(false) is not why I'm looking for, as (1) the compiler pro

Re: just stop program

2010-11-05 Thread Lars T. Kyllingstad
On Fri, 05 Nov 2010 13:20:12 +0100, spir wrote: > On Fri, 05 Nov 2010 09:47:37 + > div0 wrote: > >> On 05/11/2010 09:32, spir wrote: >> > Hello, >> > >> > Is there a way for a program to simply exit before end of main()? An >> > instruction like exit, quit, end, halt, stop... >> > >> > [asse

Unicode: how to properly read and display directory entries?

2010-11-05 Thread Tyro[a.c.edwards]
Hello, What is the proper way to read a directory such that file names are not garbled? Here is the example I borrowed form the std.file documentation. Screen shots of folder is attached. Thanks. void main(string[] args) { bool callback(DirEntry* de) { if (de.i

Re: Unicode: how to properly read and display directory entries?

2010-11-05 Thread Kagamin
Tyro[a.c.edwards] Wrote: > Hello, > > What is the proper way to read a directory such that file names are not > garbled? Here is the example I borrowed form the std.file documentation. > Screen shots of folder is attached. Thanks. > > void main(string[] args) > { > bool callback(DirEntry

Re: Unicode: how to properly read and display directory entries?

2010-11-05 Thread Kagamin
Tyro[a.c.edwards] Wrote: > void main(string[] args) > { > bool callback(DirEntry* de) > { > if (de.isfile) > mciPlay(toUTF8(de.name)); > return true; > } > > listdir("snd", &callback); > } You should also use W-functions.

Re: D2 questions

2010-11-05 Thread Steven Schveighoffer
On Fri, 05 Nov 2010 05:00:10 -0400, Lars T. Kyllingstad wrote: On Fri, 05 Nov 2010 00:00:53 -0400, ponce wrote: 4. inout(T) myFunction(inout(T) x) { inout(T) a; } Can we declare a inout(T) variable in an inout(T) function ? Currently you can, but I don't know whether that's intended

Re: just stop program

2010-11-05 Thread div0
On 05/11/2010 10:14, Lars T. Kyllingstad wrote: On Fri, 05 Nov 2010 09:47:37 +, div0 wrote: On 05/11/2010 09:32, spir wrote: Hello, Is there a way for a program to simply exit before end of main()? An instruction like exit, quit, end, halt, stop... [assert(false) is not why I'm looking f

Re: just stop program

2010-11-05 Thread div0
On 05/11/2010 15:09, div0 wrote: On 05/11/2010 10:14, Lars T. Kyllingstad wrote: On Fri, 05 Nov 2010 09:47:37 +, div0 wrote: On 05/11/2010 09:32, spir wrote: Hello, Is there a way for a program to simply exit before end of main()? An instruction like exit, quit, end, halt, stop... [asse

Re: Unicode: how to properly read and display directory entries?

2010-11-05 Thread Tyro[a.c.edwards]
On 11/5/2010 10:51 PM, Kagamin wrote: Tyro[a.c.edwards] Wrote: Hello, What is the proper way to read a directory such that file names are not garbled? Here is the example I borrowed form the std.file documentation. Screen shots of folder is attached. Thanks. void main(string[] args) {

Re: Unicode: how to properly read and display directory entries?

2010-11-05 Thread Dmitry Olshansky
On 05.11.2010 18:25, Tyro[a.c.edwards] wrote: On 11/5/2010 10:51 PM, Kagamin wrote: Tyro[a.c.edwards] Wrote: Hello, What is the proper way to read a directory such that file names are not garbled? Here is the example I borrowed form the std.file documentation. Screen shots of folder is atta

Re: Unicode: how to properly read and display directory entries?

2010-11-05 Thread Tyro[a.c.edwards]
On 11/6/2010 2:10 AM, Dmitry Olshansky wrote: On 05.11.2010 18:25, Tyro[a.c.edwards] wrote: On 11/5/2010 10:51 PM, Kagamin wrote: Tyro[a.c.edwards] Wrote: Hello, What is the proper way to read a directory such that file names are not garbled? Here is the example I borrowed form the std.file

Re: subclass instance construction

2010-11-05 Thread Tomek Sowiński
spir napisał: > I have a weird bug related to class instance construction. My guess is > that it seems a superclass's this() is implicitely called (before the > subclass's one, if any), even if overriden and without any use of "super". > In my case, I have schematically: > > === super class === >