Re: What was the reason for not including std.net.curl in the Windows phobos library?

2012-07-08 Thread Denis Shelomovskij
07.07.2012 17:11, Kevin Cox пишет: On Jul 7, 2012 8:45 AM, Gary Willoughby d...@kalekold.net mailto:d...@kalekold.net wrote: What was the reason for not including 'std.net.curl' in the Windows phobos library? IIRC it is licencing issues, they can't include curl in the distribution without

read Ogg/Mp3 file

2012-07-08 Thread Namespace
Has anyone experience with reading of .Ogg or .Mp3 files and can give me a briefing? Or does anyone know if sndfile.h was ported to D?

Re: read Ogg/Mp3 file

2012-07-08 Thread Jacob Carlborg
On 2012-07-08 12:03, Namespace wrote: Has anyone experience with reading of .Ogg or .Mp3 files and can give me a briefing? Or does anyone know if sndfile.h was ported to D? Try running it through DStep: http://forum.dlang.org/thread/jt9i6l$2go5$1...@digitalmars.com -- /Jacob Carlborg

Re: read Ogg/Mp3 file

2012-07-08 Thread Johannes Pfau
Am Sun, 08 Jul 2012 12:03:06 +0200 schrieb Namespace rswhi...@googlemail.com: Has anyone experience with reading of .Ogg or .Mp3 files and can give me a briefing? Or does anyone know if sndfile.h was ported to D? I haven't used it yet, but here's a derelict-style binding for sndfile:

Re: read Ogg/Mp3 file

2012-07-08 Thread Benjamin Thaut
Am 08.07.2012 12:03, schrieb Namespace: Has anyone experience with reading of .Ogg or .Mp3 files and can give me a briefing? Or does anyone know if sndfile.h was ported to D? I'm using libvorbis to read and OpenAL to playback .ogg files. The functions you need to import are really minimal.

Re: read Ogg/Mp3 file

2012-07-08 Thread Namespace
On Sunday, 8 July 2012 at 13:42:39 UTC, Benjamin Thaut wrote: Am 08.07.2012 12:03, schrieb Namespace: Has anyone experience with reading of .Ogg or .Mp3 files and can give me a briefing? Or does anyone know if sndfile.h was ported to D? I'm using libvorbis to read and OpenAL to playback .ogg

Re: read Ogg/Mp3 file

2012-07-08 Thread Benjamin Thaut
Am 08.07.2012 16:32, schrieb Namespace: On Sunday, 8 July 2012 at 13:42:39 UTC, Benjamin Thaut wrote: Am 08.07.2012 12:03, schrieb Namespace: Has anyone experience with reading of .Ogg or .Mp3 files and can give me a briefing? Or does anyone know if sndfile.h was ported to D? I'm using

Re: read Ogg/Mp3 file

2012-07-08 Thread Namespace
Well .ogg and .mp3 are quite similar in compression technology. But you will need a mp3 library to read them. I don't know a opensource one. I cannot open and read them like .wav files, simply with FILE* and fread? o.O I thougth i only need the structure of mp3 files and then i can read

Re: read Ogg/Mp3 file

2012-07-08 Thread Benjamin Thaut
Am 08.07.2012 16:59, schrieb Namespace: Well .ogg and .mp3 are quite similar in compression technology. But you will need a mp3 library to read them. I don't know a opensource one. I cannot open and read them like .wav files, simply with FILE* and fread? o.O I thougth i only need the structure

Re: read Ogg/Mp3 file

2012-07-08 Thread Namespace
Well yes, if you write your own mp3 decoder then you can do that. But the sound information within mp3s is compressed using inverse fourier transform and some other fancy math stuff. It will take quite some time to write all the code neccessary for reading the whole format. Kind Regards

opEquals for multiple types

2012-07-08 Thread Wouter Verhelst
Hi, I'm trying to implement opEquals. I had originally done something like class foo : bar { bool opEquals(bar e) { ... code here ... } bool opEquals(foo e) { ... somewhat more specialized code here ... } } (where bar is an interface) but that

How to execute cleanup code on Ctrl-C (Break)?

2012-07-08 Thread Paul Dufresne
I am trying to translate some C++ code to D to learn D. And the first lines to translate are: signal(SIGINT, (sighandler_t) shutdownClient); signal(SIGTERM, (sighandler_t) shutdownClient); So I come to try: import std.stdio; void main(){ try { while (true) writeln(H1!!); }

multiple inheritance

2012-07-08 Thread Namespace
How can i implement C++ behaviour like this: class Shape : Drawable, Transformable { class Sprite : Drawable { class Image : Transformable { ? One way is to declare Transformable or Drawable as interface. But what if i have more then one class which implements Transformable/Drawable and i

Re: multiple inheritance

2012-07-08 Thread Timon Gehr
On 07/08/2012 07:31 PM, Namespace wrote: How can i implement C++ behaviour like this: class Shape : Drawable, Transformable { class Sprite : Drawable { class Image : Transformable { ? One way is to declare Transformable or Drawable as interface. But what if i have more then one class which

Re: multiple inheritance

2012-07-08 Thread Wouter Verhelst
Namespace rswhi...@googlemail.com writes: How can i implement C++ behaviour like this: class Shape : Drawable, Transformable { class Sprite : Drawable { class Image : Transformable { ? One way is to declare Transformable or Drawable as interface. But what if i have more then one class

Re: multiple inheritance

2012-07-08 Thread Namespace
Smart idea. Why the inner class and not direct Transformable _t; ?

Re: multiple inheritance

2012-07-08 Thread Namespace
I made a compromise: [code] import std.stdio; interface Transformable { public: void transform(); } mixin template Transform() { public: this() { writeln(Transform Ctor); } void transform() { writeln(transformiere); } }

Re: multiple inheritance

2012-07-08 Thread Namespace
And finally: [code] import std.stdio; interface Transformable { public: void transform(); } mixin template _Transform() { public: this() { writeln(Transform Ctor); } void transform() { writeln(transformiere); } }

Re: multiple inheritance

2012-07-08 Thread Timon Gehr
On 07/08/2012 07:47 PM, Namespace wrote: Smart idea. Why the inner class and not direct Transformable _t; ? If it should be true multiple inheritance, the class must be able to override the virtual methods of each superclass and each overridden method must be given access to the fields of the

Portable way to obtain member function pointer (and invoke it)?

2012-07-08 Thread Alex Rønne Petersen
Hi, Is there a portable way to obtain a pointer to a member function and invoke it with the this reference? I seem to recall some discussion about this on the NG in the past, but can't find the thread now. -- Alex Rønne Petersen a...@lycus.org http://lycus.org

Re: Portable way to obtain member function pointer (and invoke it)?

2012-07-08 Thread Timon Gehr
On 07/08/2012 09:57 PM, Alex Rønne Petersen wrote: Hi, Is there a portable way to obtain a pointer to a member function and invoke it with the this reference? I seem to recall some discussion about this on the NG in the past, but can't find the thread now. auto mptr = function(Base o,Args

Re: Portable way to obtain member function pointer (and invoke it)?

2012-07-08 Thread Benjamin Thaut
Am 08.07.2012 21:57, schrieb Alex Rønne Petersen: Hi, Is there a portable way to obtain a pointer to a member function and invoke it with the this reference? I seem to recall some discussion about this on the NG in the past, but can't find the thread now. If you know both at compile time:

Re: How to execute cleanup code on Ctrl-C (Break)?

2012-07-08 Thread Jonathan M Davis
On Sunday, July 08, 2012 18:57:17 Paul Dufresne wrote: I am trying to translate some C++ code to D to learn D. And the first lines to translate are: signal(SIGINT, (sighandler_t) shutdownClient); signal(SIGTERM, (sighandler_t) shutdownClient); So I come to try: import std.stdio; void

Re: opEquals for multiple types

2012-07-08 Thread Jonathan M Davis
On Sunday, July 08, 2012 10:56:25 Wouter Verhelst wrote: Hi, I'm trying to implement opEquals. I had originally done something like class foo : bar { bool opEquals(bar e) { ... code here ... } bool opEquals(foo e) { ... somewhat more specialized

Compilation failure

2012-07-08 Thread Lemonfiend
Hi, I seem to have run into a strange error.. When I put tmp1 outside the main loop, it compiles fine and gives the expected output. When tmp1 is put inside the main loop, the compiler seems to get stuck in a loop? I've tested it on: http://dlang.org/index.html See error on bottom (lol)

Re: Compilation failure

2012-07-08 Thread bearophile
When I put tmp1 outside the main loop, it compiles fine and gives the expected output. When tmp1 is put inside the main loop, the compiler seems to get stuck in a loop? //immutable int[] tmp1 = [1, 2]; // compiles void main() { immutable int[] tmp1 = [1, 2]; // does not

Re: Compilation failure

2012-07-08 Thread bearophile
The large number of the same error message is small a compiler diagnostic bug, that should be reported in bugzilla. It was already reported by me, I have added your case: http://d.puremagic.com/issues/show_bug.cgi?id=8312 Bye, bearophile

Re: Compilation failure

2012-07-08 Thread bearophile
When tmp1 is defined globally, dmd is doing something different, in some way it sees global immutables almost as enums... I don't know if this is present in D specs. You see it well with this test program: immutable int[] A = [1]; template Foo(size_t n) {} void main() { alias

Linking OpenSSL on Windows

2012-07-08 Thread Andy
I've been using D on linux for a few months now and have the hang of it. I wrote a project that should be able to be compiled on both Linux and Windows. I've gotten it to work excellently on Linux, but I can't seem to figure out how to link the openssl dll files on Windows. On linux, a simple

Re: How to execute cleanup code on Ctrl-C (Break)?

2012-07-08 Thread Paul Dufresne
Well, I was looking the documentation and not finding how to catch signals. I thought, hey, does Windows have Posix signals? And the answer seems to be that Windows conform to Posix.1 (which is old, but does define signals)... after all, the code I want to translate does run in MinGW. So, I

Re: How to execute cleanup code on Ctrl-C (Break)?

2012-07-08 Thread Jonathan M Davis
On Monday, July 09, 2012 03:31:52 Paul Dufresne wrote: Well, I was looking the documentation and not finding how to catch signals. I thought, hey, does Windows have Posix signals? And the answer seems to be that Windows conform to Posix.1 (which is old, but does define signals)... after

Re: Linking OpenSSL on Windows

2012-07-08 Thread dnewbie
On Sunday, 8 July 2012 at 22:33:15 UTC, Andy wrote: I've been using D on linux for a few months now and have the hang of it. I wrote a project that should be able to be compiled on both Linux and Windows. I've gotten it to work excellently on Linux, but I can't seem to figure out how to link

Re: How to execute cleanup code on Ctrl-C (Break)?

2012-07-08 Thread Paul Dufresne
Well, I just want to close a socket before quiting if the user press Ctrl-C. That said, looking through the code, I would say that it have no implementation for Windows... even if it should have signals. And even there, I do not really understand how I am suppose to use it. I think it

Re: How to execute cleanup code on Ctrl-C (Break)?

2012-07-08 Thread Jonathan M Davis
On Monday, July 09, 2012 04:15:08 Paul Dufresne wrote: Well, I just want to close a socket before quiting if the user press Ctrl-C. That said, looking through the code, I would say that it have no implementation for Windows... even if it should have signals. And even there, I do not

Re: How to execute cleanup code on Ctrl-C (Break)?

2012-07-08 Thread Mike Parker
On 07/09/2012 11:15 AM, Paul Dufresne wrote: Well, I just want to close a socket before quiting if the user press Ctrl-C. That said, looking through the code, I would say that it have no implementation for Windows... even if it should have signals. And even there, I do not really understand