Re: Playing .wav files

2013-01-04 Thread Namespace
On Saturday, 5 January 2013 at 07:13:02 UTC, Tomas wrote: On Saturday, 5 January 2013 at 07:04:48 UTC, Namespace wrote: On Saturday, 5 January 2013 at 06:42:55 UTC, Tomas wrote: Hey, guys! Sorry for my bad English. I wanna ask a question... How can I play .wav files in my D program? Thank you.

Re: Playing .wav files

2013-01-04 Thread Tomas
On Saturday, 5 January 2013 at 07:04:48 UTC, Namespace wrote: On Saturday, 5 January 2013 at 06:42:55 UTC, Tomas wrote: Hey, guys! Sorry for my bad English. I wanna ask a question... How can I play .wav files in my D program? Thank you. :) With SDL_Mixer or OpenAL. For both there are wrappers

Re: Playing .wav files

2013-01-04 Thread Namespace
On Saturday, 5 January 2013 at 06:42:55 UTC, Tomas wrote: Hey, guys! Sorry for my bad English. I wanna ask a question... How can I play .wav files in my D program? Thank you. :) With SDL_Mixer or OpenAL. For both there are wrappers which you can find here: http://www.dsource.org/projects/derel

Playing .wav files

2013-01-04 Thread Tomas
Hey, guys! Sorry for my bad English. I wanna ask a question... How can I play .wav files in my D program? Thank you. :)

Re: asynchronous communication between threads

2013-01-04 Thread Charles Hixson
On 01/04/2013 02:56 AM, Dmitry Olshansky wrote: 04-Jan-2013 10:36, Charles Hixson пишет: [snip] So cell is in fact a task (more common name for it I think) with a mailbox and you want threads multiplexed across these tasks. The task is running some code/function/callback/whatever that periodical

Re: Type inference + forwarding lambda predicate

2013-01-04 Thread Maxim Fomin
On Friday, 4 January 2013 at 16:06:38 UTC, Jacob Carlborg wrote: The following code results in a Segmentation fault: 11. The reason seems to be because "any" is called indefinitely. But if I don't use type inference for the lambda it works correctly. import algorithm = std.algorithm; bool any

Re: checking double.nan

2013-01-04 Thread monarch_dodra
On Friday, 4 January 2013 at 16:29:13 UTC, bearophile wrote: monarch_dodra: std.math.isNaN only works for floats. The signature of the function shows it accepts a real: pure nothrow @trusted bool isNaN(real x); Bye, bearophile I am retarded. I had a compile error I miss-read, and was thro

Re: checking double.nan

2013-01-04 Thread bearophile
monarch_dodra: std.math.isNaN only works for floats. The signature of the function shows it accepts a real: pure nothrow @trusted bool isNaN(real x); Bye, bearophile

checking double.nan

2013-01-04 Thread monarch_dodra
All in the title. I searched but couldn't find. std.math.isNaN only works for floats. Is it safe to cast the double to float? Why don't we have "isNaN(double)" (this is an honest question, to learn, not requesting anything... yet).

Type inference + forwarding lambda predicate

2013-01-04 Thread Jacob Carlborg
The following code results in a Segmentation fault: 11. The reason seems to be because "any" is called indefinitely. But if I don't use type inference for the lambda it works correctly. import algorithm = std.algorithm; bool any (alias predicate, Range) (Range range) { return algorithm.any

Re: Compile Time Argument Evaluation

2013-01-04 Thread Philippe Sigaud
On Fri, Jan 4, 2013 at 2:59 AM, bearophile wrote: > >> Someday I'd like a function like this in Phobos, that verifies the > formatting string at compile-time: > > ctwritefln!"%d %s"(5, "hello"); > > Such function can be written with just a very light wrapper around a > normal writefln (and later

Re: asynchronous communication between threads

2013-01-04 Thread Dmitry Olshansky
04-Jan-2013 10:36, Charles Hixson пишет: [snip] So cell is in fact a task (more common name for it I think) with a mailbox and you want threads multiplexed across these tasks. The task is running some code/function/callback/whatever that periodically polls a mailbox & puts stuff in other task's m