Re: SFML-D working example

2012-10-21 Thread Zhenya
On Sunday, 21 October 2012 at 03:37:20 UTC, Ellery Newcomer wrote: On Saturday, 20 October 2012 at 20:25:09 UTC, Zhenya wrote: Hi!I have a little problem with building example.I downloaded SFML-D working example at this adress https://github.com/krzat/SFML-D/downloads.But then I tried to

Re: SFML-D working example

2012-10-21 Thread Zhenya
On Sunday, 21 October 2012 at 07:34:29 UTC, Zhenya wrote: On Sunday, 21 October 2012 at 03:37:20 UTC, Ellery Newcomer wrote: On Saturday, 20 October 2012 at 20:25:09 UTC, Zhenya wrote: Hi!I have a little problem with building example.I downloaded SFML-D working example at this adress

Re: Deimos organization

2012-10-21 Thread David
Am 21.10.2012 07:52, schrieb Matt Soucy: I've been messing around with Deimos lately, and I was a little bit confused about some of the design. I saw that a couple (ZeroMQ, ncurses) didn't follow the usual structure of having a c/ and a deimos/ folder. Is this by design, or is it something

Re: override toString of Exception

2012-10-21 Thread David
when throwing this exception, I still get the stacktrace and not bar, is it possible to change that behaviour? Perhaps this function can help: http://dlang.org/phobos/core_runtime.html#traceHandler Unfortunatly not, it expects a function which returns TraceInfo, but I simply wanna modify

Re: Deimos organization

2012-10-21 Thread 1100110
On Sun, 21 Oct 2012 00:52:02 -0500, Matt Soucy mso...@csh.rit.edu wrote: I've been messing around with Deimos lately, and I was a little bit confused about some of the design. I saw that a couple (ZeroMQ, ncurses) didn't follow the usual structure of having a c/ and a deimos/ folder. Is this

Re: Deimos organization

2012-10-21 Thread 1100110
Other things I was unsure about: libmysql, libc, libruby, lua don't have any D files at all - some are just READMEs. Are these still under development? libexif goes libexif/libexif/(d files) instead of libexif/deimos/libexif/(d files). Also by design? Let me amend that. I won't do libc.

Re: override toString of Exception

2012-10-21 Thread Ali Çehreli
On 10/20/2012 09:42 AM, David wrote: class BraLaException : Exception { this(string s, string f=__FILE__, size_t l=__LINE__) { super(s, f, l); } override string toString() { return bar; } } when throwing this exception, I still get the stacktrace and not bar, is it possible to change that

Overload resolution (value vs reference)

2012-10-21 Thread m0rph
How does compiler selects the proper function among overloaded functions which differ only in the way the argument is passed (by reference or by value)? Is there a way, to control this behavior? Result of execution of the test code: passed by value: 8 passed by value: 3 passed by value: Foo(10)

Re: More automated interfacing of D with C codebases

2012-10-21 Thread Brad Lanam
I don't think this is exactly what you want either, but it's certainly a lot easier than a manual process: http://gentoo.com/di/mkconfig.html (On Freecode) https://freecode.com/projects/mkconfig I just now released a new version. Freecode will be updated within 24 hours. Check the

Re: More automated interfacing of D with C codebases

2012-10-21 Thread timotheecour
Manually porting of C/C++ libraries shouldn't be the way to go (a major problem being when said library gets updated, human errors, porting to different architectures etc). I've had good experience using SWIG to automate the job for me, and used it successfully to port the following libraries to

Re: More automated interfacing of D with C codebases

2012-10-21 Thread Brad Lanam
On Sunday, 21 October 2012 at 19:45:53 UTC, timotheecour wrote: I've had good experience using SWIG to automate the job for me, and used it successfully to port the following libraries to D: Yes. SWIG should be a lot faster than my tool. Also I don't have any units to handle C++ code.

Re: class opBinary overloading. value + null and null + value

2012-10-21 Thread cal
On Sunday, 21 October 2012 at 20:34:51 UTC, ref2401 wrote: what should i do to make my binary operation commutative? You can overload opBinaryRight: MyClass opBinaryRight(string op: +)(MyClass rhs) { if (rhs is null) { return null; } MyClass result = new MyClass(value +

Re: override toString of Exception

2012-10-21 Thread David
This behavior makes sense to me because printing the backtrace should concern the application, not the exception itself. If the application does not want the backtrace printed, it can handle all of the exceptions. Ali I just want to add color to my exceptions and the easiest way is to

Re: class opBinary overloading. value + null and null + value

2012-10-21 Thread ref2401
On Sunday, 21 October 2012 at 20:42:08 UTC, cal wrote: On Sunday, 21 October 2012 at 20:34:51 UTC, ref2401 wrote: what should i do to make my binary operation commutative? You can overload opBinaryRight: MyClass opBinaryRight(string op: +)(MyClass rhs) { if (rhs is null) { return

Re: override toString of Exception

2012-10-21 Thread David
Am 21.10.2012 22:46, schrieb David: This behavior makes sense to me because printing the backtrace should concern the application, not the exception itself. If the application does not want the backtrace printed, it can handle all of the exceptions. Ali I just want to add color

Re: class opBinary overloading. value + null and null + value

2012-10-21 Thread cal
On Sunday, 21 October 2012 at 20:54:15 UTC, ref2401 wrote: On Sunday, 21 October 2012 at 20:42:08 UTC, cal wrote: On Sunday, 21 October 2012 at 20:34:51 UTC, ref2401 wrote: what should i do to make my binary operation commutative? in the following case auto v5 = v1 + v2; there will be

Re: Overload resolution (value vs reference)

2012-10-21 Thread Jonathan M Davis
On Sun, 2012-10-21 at 19:01 +0200, m0rph wrote: How does compiler selects the proper function among overloaded functions which differ only in the way the argument is passed (by reference or by value)? Is there a way, to control this behavior? Result of execution of the test code: passed by

Slices and array appending

2012-10-21 Thread cal
Just want to make sure I understand this properly: I have a large dynamic array (whose elements are immutable) which only ever grows. I also have a whole lot of small slices into this array, the slices never change, and they don't span the entire contents of the array (they are just pieces).

Reordered class fields?

2012-10-21 Thread bearophile
D classes are free to reorder their fields, so maybe Bar1 should reorder its fields as Bar3, to save 4 bytes for each instance on 32 bit systems: class Bar1 { void Hello() {} float f; double d; } class Bar2 { void Hello() {} align(4) float f; align(4) double d; } class

Re: Slices and array appending

2012-10-21 Thread Era Scarecrow
On Sunday, 21 October 2012 at 23:35:30 UTC, cal wrote: Just want to make sure I understand this properly: I have a large dynamic array (whose elements are immutable) which only ever grows. I also have a whole lot of small slices into this array, the slices never change, and they don't span

Re: override toString of Exception

2012-10-21 Thread Ali Çehreli
On 10/21/2012 01:51 PM, David wrote: Am 21.10.2012 22:46, schrieb David: This behavior makes sense to me because printing the backtrace should concern the application, not the exception itself. If the application does not want the backtrace printed, it can handle all of the exceptions.

Re: Slices and array appending

2012-10-21 Thread Jonathan M Davis
On Monday, October 22, 2012 01:35:29 cal wrote: Just want to make sure I understand this properly: I have a large dynamic array (whose elements are immutable) which only ever grows. I also have a whole lot of small slices into this array, the slices never change, and they don't span the