Re: About Dub capabilities

2017-07-04 Thread Dukc via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 21:02:55 UTC, Martin Nowak wrote: preGenerate-/preBuildCommands are your friends to compile C++ code using dub. Hod did I not notice them... but that answers the question, thanks.

Re: Need simple sound

2017-07-04 Thread FoxyBrown via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 20:37:44 UTC, Sebastiaan Koppe wrote: On Monday, 3 July 2017 at 08:55:20 UTC, Martin Tschierschke wrote: Hello for a simple game I would like to add some very simple sound, not much different than the beeps of "PAC Man". Is there anything I can use for this? Portaud

Re: Need simple sound

2017-07-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 17:51:06 UTC, Dukc wrote: When simplicity is the matter number 1, Arsd-official most likely what you're looking for. It has a library file for audio. Simpleaudio.d or Simplesound.d, not sure which it was. simpleaudio.d. It'd probably be good enough for this (it works

Re: Append to 'map' result

2017-07-04 Thread Ali Çehreli via Digitalmars-d-learn
On 07/04/2017 05:52 PM, Jean-Louis Leroy wrote: On Wednesday, 5 July 2017 at 00:28:01 UTC, Ali Çehreli wrote: On 07/04/2017 04:57 PM, Jean-Louis Leroy wrote: [...] No time to dig deeper but this is because the two ranges that chain() receives do not have a common type. (Rather, that type is 'v

Re: Append to 'map' result

2017-07-04 Thread Jean-Louis Leroy via Digitalmars-d-learn
On Wednesday, 5 July 2017 at 00:28:01 UTC, Ali Çehreli wrote: On 07/04/2017 04:57 PM, Jean-Louis Leroy wrote: [...] No time to dig deeper but this is because the two ranges that chain() receives do not have a common type. (Rather, that type is 'void'): [...] I suspect that that is the reas

Re: Append to 'map' result

2017-07-04 Thread Ali Çehreli via Digitalmars-d-learn
On 07/04/2017 04:57 PM, Jean-Louis Leroy wrote: On Tuesday, 4 July 2017 at 23:26:28 UTC, H. S. Teoh wrote: On Tue, Jul 04, 2017 at 11:27:25PM +, Jean-Louis Leroy via Digitalmars-d-learn wrote: I want to create a range that consists of the result of a map() followed by a value, e.g.: int[

Re: Append to 'map' result

2017-07-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, July 04, 2017 23:50:57 Nicholas Wilson via Digitalmars-d-learn wrote: > On Tuesday, 4 July 2017 at 23:27:25 UTC, Jean-Louis Leroy wrote: > > I want to create a range that consists of the result of a map() > > > > followed by a value, e.g.: > > int[] x = [ 1, 2, 3]; > > auto y = map

Re: Append to 'map' result

2017-07-04 Thread Jean-Louis Leroy via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 23:26:28 UTC, H. S. Teoh wrote: On Tue, Jul 04, 2017 at 11:27:25PM +, Jean-Louis Leroy via Digitalmars-d-learn wrote: I want to create a range that consists of the result of a map() followed by a value, e.g.: int[] x = [ 1, 2, 3]; auto y = map!(x => x * x)(x);

Re: Append to 'map' result

2017-07-04 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 23:27:25 UTC, Jean-Louis Leroy wrote: I want to create a range that consists of the result of a map() followed by a value, e.g.: int[] x = [ 1, 2, 3]; auto y = map!(x => x * x)(x); auto z = y ~ 99; // how??? I have tried several variations: convert 99 to a dyna

Re: Append to 'map' result

2017-07-04 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jul 04, 2017 at 11:27:25PM +, Jean-Louis Leroy via Digitalmars-d-learn wrote: > I want to create a range that consists of the result of a map() > followed by a value, e.g.: > > int[] x = [ 1, 2, 3]; > auto y = map!(x => x * x)(x); > auto z = y ~ 99; // how??? > > I have tried s

Append to 'map' result

2017-07-04 Thread Jean-Louis Leroy via Digitalmars-d-learn
I want to create a range that consists of the result of a map() followed by a value, e.g.: int[] x = [ 1, 2, 3]; auto y = map!(x => x * x)(x); auto z = y ~ 99; // how??? I have tried several variations: convert 99 to a dynamic array, to a range, convert range to dynamic array (couldn't e

Re: About Dub capabilities

2017-07-04 Thread Martin Nowak via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 20:46:33 UTC, Dukc wrote: Not that I have any need for that right now, I am just interested. preGenerate-/preBuildCommands are your friends to compile C++ code using dub. You'd invoke make or sth. and add the generated libs/objects to dub's sourceFiles. http://code

About Dub capabilities

2017-07-04 Thread Dukc via Digitalmars-d-learn
When you want to do things other than just fetching packages, invoking D compilers and converting package descriptors, I am wondering is Dub up to it? For example, could dmd source code build (if somebody wanted to) be automated with Dub instead of CMake, bearing in mind it requires some c++

Re: Need simple sound

2017-07-04 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Monday, 3 July 2017 at 08:55:20 UTC, Martin Tschierschke wrote: Hello for a simple game I would like to add some very simple sound, not much different than the beeps of "PAC Man". Is there anything I can use for this? Portaudio is simple as well. And nice cross platform.

Re: Need simple sound

2017-07-04 Thread Dukc via Digitalmars-d-learn
On Monday, 3 July 2017 at 08:55:20 UTC, Martin Tschierschke wrote: Hello for a simple game I would like to add some very simple sound, not much different than the beeps of "PAC Man". Is there anything I can use for this? When simplicity is the matter number 1, Arsd-official most likely what y

Re: Need simple sound

2017-07-04 Thread Martin Tschierschke via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 11:59:33 UTC, Vladimir Panteleev wrote: On Monday, 3 July 2017 at 10:40:03 UTC, Martin Tschierschke wrote: On Monday, 3 July 2017 at 09:24:35 UTC, Guillaume Piolat wrote: On Monday, 3 July 2017 at 08:55:20 UTC, Martin Tschierschke wrote: Hello for a simple game I woul

Re: Funny issue with casting double to ulong

2017-07-04 Thread Era Scarecrow via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 12:32:26 UTC, Patrick Schluter wrote: In times of lore, BCD floats were very common. The Sharp Pocket Computer used a BCD float format and writing machine code on them confronts one with the format. The TI-99/4A home computer also used a BCD float format in its Basic

Re: Funny issue with casting double to ulong

2017-07-04 Thread Patrick Schluter via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 00:35:10 UTC, H. S. Teoh wrote: On Mon, Jul 03, 2017 at 07:13:45AM +, Era Scarecrow via Digitalmars-d-learn wrote: On Monday, 3 July 2017 at 06:20:22 UTC, H. S. Teoh wrote: [...] > I don't think there's a way to change how the FPU works -- > the hardware is coded

Re: safe method overloading with different refness of its arguments

2017-07-04 Thread drug via Digitalmars-d-learn
04.07.2017 15:06, Basile B. пишет: On Tuesday, 4 July 2017 at 10:40:42 UTC, drug wrote: ``` struct Foo { ubyte width, length; // by reference bool opEquals(ref const(Foo) other) const pure @safe { if (width != other.width) return false; if (length !=

Re: safe method overloading with different refness of its arguments

2017-07-04 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 10:40:42 UTC, drug wrote: ``` struct Foo { ubyte width, length; // by reference bool opEquals(ref const(Foo) other) const pure @safe { if (width != other.width) return false; if (length != other.length) return fal

Re: Need simple sound

2017-07-04 Thread Vladimir Panteleev via Digitalmars-d-learn
On Monday, 3 July 2017 at 10:40:03 UTC, Martin Tschierschke wrote: On Monday, 3 July 2017 at 09:24:35 UTC, Guillaume Piolat wrote: On Monday, 3 July 2017 at 08:55:20 UTC, Martin Tschierschke wrote: Hello for a simple game I would like to add some very simple sound, not much different than the b

Re: How to get uniq to return an array?

2017-07-04 Thread maarten van damme via Digitalmars-d-learn
have you tried std.range's .array? 2017-07-04 13:00 GMT+02:00 PumpkinCake via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com>: > I'm trying to strip repeated values out of an int array using uniq. It's > returning a UniqResult which can't be accessed like an array... how can I > get it t

Re: How to get uniq to return an array?

2017-07-04 Thread cym13 via Digitalmars-d-learn
On Tuesday, 4 July 2017 at 11:00:05 UTC, PumpkinCake wrote: I'm trying to strip repeated values out of an int array using uniq. It's returning a UniqResult which can't be accessed like an array... how can I get it to return an array, or cast whatever it is returning to be an array? Most funct

How to get uniq to return an array?

2017-07-04 Thread PumpkinCake via Digitalmars-d-learn
I'm trying to strip repeated values out of an int array using uniq. It's returning a UniqResult which can't be accessed like an array... how can I get it to return an array, or cast whatever it is returning to be an array?

safe method overloading with different refness of its arguments

2017-07-04 Thread drug via Digitalmars-d-learn
``` struct Foo { ubyte width, length; // by reference bool opEquals(ref const(Foo) other) const pure @safe { if (width != other.width) return false; if (length != other.length) return false; return true; } // by value bo