Re: functional way doing array stuff/ lambda functions

2015-12-13 Thread cym13 via Digitalmars-d-learn
On Sunday, 13 December 2015 at 03:08:33 UTC, Namal wrote: On Saturday, 12 December 2015 at 23:50:55 UTC, Xinok wrote: [...] I tried this, it compiles, but crashes when I try to run it: object.Exception@/usr/include/dmd/phobos/std/algorithm/iteration.d(2481): Enforcement failed

Re: functional way doing array stuff/ lambda functions

2015-12-13 Thread visitor via Digitalmars-d-learn
On Sunday, 13 December 2015 at 03:08:33 UTC, Namal wrote: This works for me : import std.stdio, std.algorithm, std.range; int[] prim_factors(int n, const int[] P) { int[] v; P.filter!( x => x*x <= n).each!( (i) { while (n % i == 0) { v ~= i; n /= i;

deep copying / .dup / template object.dup cannot deduce function from argument types

2015-12-13 Thread Robert M. Münch via Digitalmars-d-learn
Hi, I just wanted to naively copy an object and used: a = myobj.dup; and get the following error messages: source/app.d(191): Error: template object.dup cannot deduce function from argument types !()(BlockV), candidates are: /Library/D/dmd/src/druntime/import/object.d(1872):

Re: D programming video tutorial

2015-12-13 Thread cym13 via Digitalmars-d-learn
On Sunday, 13 December 2015 at 20:29:47 UTC, Pederator wrote: Hi. Does anybody who is familair with D consider to make a comprehensive D programming video tutorial / training / course? This could be encouraging and helpful for people to start with D. It could also help in promoting D

Re: D programming video tutorial

2015-12-13 Thread Xinok via Digitalmars-d-learn
On Sunday, 13 December 2015 at 20:29:47 UTC, Pederator wrote: Hi. Does anybody who is familair with D consider to make a comprehensive D programming video tutorial / training / course? This could be encouraging and helpful for people to start with D. It could also help in promoting D

Re: D programming video tutorial

2015-12-13 Thread Pederator via Digitalmars-d-learn
On Sunday, 13 December 2015 at 20:45:56 UTC, cym13 wrote: On Sunday, 13 December 2015 at 20:29:47 UTC, Pederator wrote: Hi. Does anybody who is familair with D consider to make a comprehensive D programming video tutorial / training / course? This could be encouraging and helpful for people to

Implicit Interface Deduction

2015-12-13 Thread Faux Amis via Digitalmars-d-learn
interface IA {} interface IB {} interface IC {} interface IAB : IA, IB {} interface IBC : IB, IC {} class C : IA, IB, IC {} // Defining C as : IAB, IBC // is not really scalable ;) void main() { IAB c = new C(); // This doesn't work. } // Any suggestions?

Re: [Dgame] Is there Multiple Window support?

2015-12-13 Thread Namespace via Digitalmars-d-learn
On Sunday, 13 December 2015 at 06:33:55 UTC, Jack wrote: Hello, so I've been experimenting with the framework and I tried to implement a game that has more than two windows. The first window is the main game and the second window is a smaller one with the various commands you can select. So

D programming video tutorial

2015-12-13 Thread Pederator via Digitalmars-d-learn
Hi. Does anybody who is familair with D consider to make a comprehensive D programming video tutorial / training / course? This could be encouraging and helpful for people to start with D. It could also help in promoting D programming language. This is a question for all the community, please

Re: D programming video tutorial

2015-12-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 13 December 2015 at 20:29:47 UTC, Pederator wrote: Does anybody who is familair with D consider to make a comprehensive D programming video tutorial / training / course? I've hired someone out of my own pocket to work on it, with me there to answer questions and review content for

Re: deep copying / .dup / template object.dup cannot deduce function from argument types

2015-12-13 Thread Alex Parrill via Digitalmars-d-learn
On Sunday, 13 December 2015 at 18:54:24 UTC, Robert M. Münch wrote: Hi, I just wanted to naively copy an object and used: a = myobj.dup; and get the following error messages: source/app.d(191): Error: template object.dup cannot deduce function from argument types !()(BlockV), candidates are:

Re: D programming video tutorial

2015-12-13 Thread Rikki Cattermole via Digitalmars-d-learn
On 14/12/15 11:04 AM, Xinok wrote: On Sunday, 13 December 2015 at 20:29:47 UTC, Pederator wrote: Hi. Does anybody who is familair with D consider to make a comprehensive D programming video tutorial / training / course? This could be encouraging and helpful for people to start with D. It could

Re: Implicit Interface Deduction

2015-12-13 Thread Ali Çehreli via Digitalmars-d-learn
On 12/13/2015 02:09 PM, Faux Amis wrote: interface IA {} interface IB {} interface IC {} interface IAB : IA, IB {} interface IBC : IB, IC {} class C : IA, IB, IC {} // Defining C as : IAB, IBC // is not really scalable ;) It is not automatic at least because of implementation details: The

Re: Implicit Interface Deduction

2015-12-13 Thread Chris Wright via Digitalmars-d-learn
On Sun, 13 Dec 2015 23:09:47 +0100, Faux Amis wrote: > interface IA {} > interface IB {} > interface IC {} > interface IAB : IA, IB {} interface IBC : IB, IC {} > > class C : IA, IB, IC {} > // Defining C as : IAB, IBC // is not really scalable ;) > > void main() > { > IAB c = new C(); //