Re: Bug in D!!!

2017-09-04 Thread crimaniak via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 20:47:12 UTC, EntangledQuanta wrote: interface I { void Go(T)(S!T s); static final I New() { return new C(); } } abstract class A : I { } class C : A { void Go(T)(S!T s) {

Re: Bug in D!!!

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 4 September 2017 at 03:08:50 UTC, EntangledQuanta wrote: On Monday, 4 September 2017 at 01:50:48 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 23:25:47 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 11:48:38 UTC, Moritz Maxeiner wrote: On Sunday, 3 September

Re: Bug in D!!!

2017-09-03 Thread EntangledQuanta via Digitalmars-d-learn
On Monday, 4 September 2017 at 01:50:48 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 23:25:47 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 11:48:38 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 04:18:03 UTC, EntangledQuanta wrote: On Sunday, 3 September

Re: Bug in D!!!

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 3 September 2017 at 23:25:47 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 11:48:38 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 04:18:03 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 02:39:19 UTC, Moritz Maxeiner wrote: On Saturday, 2

Re: Bug in D!!!

2017-09-03 Thread EntangledQuanta via Digitalmars-d-learn
On Sunday, 3 September 2017 at 11:48:38 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 04:18:03 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 02:39:19 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 23:12:35 UTC, EntangledQuanta wrote: [...] The

Re: Bug in D!!!

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 3 September 2017 at 04:18:03 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 02:39:19 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 23:12:35 UTC, EntangledQuanta wrote: [...] The contexts being independent of each other doesn't change that we would still

Re: Bug in D!!!

2017-09-02 Thread EntangledQuanta via Digitalmars-d-learn
On Sunday, 3 September 2017 at 02:39:19 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 23:12:35 UTC, EntangledQuanta wrote: On Saturday, 2 September 2017 at 21:19:31 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 00:00:43 UTC, EntangledQuanta wrote: On Friday, 1

Re: Bug in D!!!

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 23:12:35 UTC, EntangledQuanta wrote: On Saturday, 2 September 2017 at 21:19:31 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 00:00:43 UTC, EntangledQuanta wrote: On Friday, 1 September 2017 at 23:25:04 UTC, Jesse Phillips wrote: I've love being

Re: Bug in D!!!

2017-09-02 Thread EntangledQuanta via Digitalmars-d-learn
On Saturday, 2 September 2017 at 21:19:31 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 00:00:43 UTC, EntangledQuanta wrote: On Friday, 1 September 2017 at 23:25:04 UTC, Jesse Phillips wrote: I've love being able to inherit and override generic functions in C#. Unfortunately C#

Re: Bug in D!!!

2017-09-02 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 2 September 2017 at 00:00:43 UTC, EntangledQuanta wrote: On Friday, 1 September 2017 at 23:25:04 UTC, Jesse Phillips wrote: I've love being able to inherit and override generic functions in C#. Unfortunately C# doesn't use templates and I hit so many other issues where Generics

Re: Bug in D!!!

2017-09-02 Thread EntangledQuanta via Digitalmars-d-learn
On Saturday, 2 September 2017 at 16:20:10 UTC, Jesse Phillips wrote: On Saturday, 2 September 2017 at 00:00:43 UTC, EntangledQuanta wrote: Regardless of the implementation, the idea that we should throw the baby out with the bathwater is simply wrong. At least there are a few who get that. By

Re: Bug in D!!!

2017-09-02 Thread Jesse Phillips via Digitalmars-d-learn
On Saturday, 2 September 2017 at 00:00:43 UTC, EntangledQuanta wrote: Regardless of the implementation, the idea that we should throw the baby out with the bathwater is simply wrong. At least there are a few who get that. By looking in to it in a serious manner an event better solution might

Re: Bug in D!!!

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
On Friday, 1 September 2017 at 23:25:04 UTC, Jesse Phillips wrote: I've love being able to inherit and override generic functions in C#. Unfortunately C# doesn't use templates and I hit so many other issues where Generics just suck. I don't think it is appropriate to dismiss the need for the

Re: Bug in D!!!

2017-09-01 Thread Jesse Phillips via Digitalmars-d-learn
I've love being able to inherit and override generic functions in C#. Unfortunately C# doesn't use templates and I hit so many other issues where Generics just suck. I don't think it is appropriate to dismiss the need for the compiler to generate a virtual function for every instantiated T,

Re: Bug in D!!!

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
This happens when building, not running. This might be a Visual D issue as when I use dmd from the command line, it works fine ;/

Re: Bug in D!!!

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
On Friday, 1 September 2017 at 19:25:53 UTC, Adam D Ruppe wrote: On Friday, 1 September 2017 at 18:17:22 UTC, EntangledQuanta wrote: I get an access violation, changed the code to What is the rest of your code? access violation usually means you didn't new the class... No, that is the

Re: Bug in D!!!

2017-09-01 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 1 September 2017 at 18:17:22 UTC, EntangledQuanta wrote: I get an access violation, changed the code to What is the rest of your code? access violation usually means you didn't new the class...

Re: Bug in D!!!

2017-09-01 Thread EntangledQuanta via Digitalmars-d-learn
On Friday, 1 September 2017 at 15:24:39 UTC, Adam D. Ruppe wrote: static foreach is now in the new release! You can now do stuff like: --- alias I(A...) = A; interface Foo { static foreach(T; I!(int, float)) void set(T t); // define virt funcs for a list of types }

Re: Bug in D!!!

2017-09-01 Thread Adam D. Ruppe via Digitalmars-d-learn
static foreach is now in the new release! You can now do stuff like: --- alias I(A...) = A; interface Foo { static foreach(T; I!(int, float)) void set(T t); // define virt funcs for a list of types } class Ass : Foo { static foreach(T; I!(int, float))

Re: Bug in D!!!

2017-09-01 Thread Biotronic via Digitalmars-d-learn
On Thursday, 31 August 2017 at 15:48:12 UTC, EntangledQuanta wrote: On Thursday, 31 August 2017 at 10:34:14 UTC, Kagamin wrote: On Thursday, 31 August 2017 at 00:49:22 UTC, EntangledQuanta wrote: I've already implemented a half ass library solution. It can be improved alot. Then, by all

Re: Bug in D!!!

2017-08-31 Thread EntangledQuanta via Digitalmars-d-learn
On Thursday, 31 August 2017 at 10:34:14 UTC, Kagamin wrote: On Thursday, 31 August 2017 at 00:49:22 UTC, EntangledQuanta wrote: I've already implemented a half ass library solution. It can be improved alot. Then, by all means, genius!

Re: Bug in D!!!

2017-08-31 Thread Kagamin via Digitalmars-d-learn
On Thursday, 31 August 2017 at 00:49:22 UTC, EntangledQuanta wrote: I've already implemented a half ass library solution. It can be improved alot.

Re: Bug in D!!!

2017-08-30 Thread Ali Çehreli via Digitalmars-d-learn
On 08/30/2017 05:49 PM, EntangledQuanta wrote: > The compiler can and should do this! Yes, the compiler can do it for each compilation but there is also the feature called /separate compilation/ that D supports. With separate compilation, there would potentially be multiple different and

Re: Bug in D!!!

2017-08-30 Thread EntangledQuanta via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 22:52:41 UTC, Adam D. Ruppe wrote: On Wednesday, 30 August 2017 at 20:47:12 UTC, EntangledQuanta wrote: This is quite surprising! In the new version pending release (scheduled for later this week), we get a new feature `static foreach` that will let you loop

Re: Bug in D!!!

2017-08-30 Thread EntangledQuanta via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 22:08:03 UTC, Jonathan M Davis wrote: On Wednesday, August 30, 2017 21:51:57 EntangledQuanta via Digitalmars-d- learn wrote: [...] Templates have no idea what arguments you intend to use with them. You can pass them any arguments you want, and as long as they

Re: Bug in D!!!

2017-08-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 20:47:12 UTC, EntangledQuanta wrote: This is quite surprising! In the new version pending release (scheduled for later this week), we get a new feature `static foreach` that will let you loop through the types you want and declare all the functions that way.

Re: Bug in D!!!

2017-08-30 Thread EntangledQuanta via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 22:08:03 UTC, Jonathan M Davis wrote: On Wednesday, August 30, 2017 21:51:57 EntangledQuanta via Digitalmars-d- learn wrote: The point you are trying to making, and not doing a great job, is that the compiler cannot create an unknown set of virtual functions

Re: Bug in D!!!

2017-08-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, August 30, 2017 21:51:57 EntangledQuanta via Digitalmars-d- learn wrote: > The point you are trying to making, and not doing a great job, is > that the compiler cannot create an unknown set of virtual > functions from a single templated virtual function. BUT, when you > realize that

Re: Bug in D!!!

2017-08-30 Thread EntangledQuanta via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 21:33:30 UTC, Jonathan M Davis wrote: On Wednesday, August 30, 2017 20:47:12 EntangledQuanta via Digitalmars-d- learn wrote: This is quite surprising! public struct S(T) { T s; } interface I { void Go(T)(S!T s); static final I New() { return new

Re: Bug in D!!!

2017-08-30 Thread lobo via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 20:47:12 UTC, EntangledQuanta wrote: This is quite surprising! public struct S(T) { T s; } interface I { void Go(T)(S!T s); static final I New() { return new C(); } } abstract class A : I {

Re: Bug in D!!!

2017-08-30 Thread EntangledQuanta via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 21:13:19 UTC, Kagamin wrote: It can't work this way. You can try std.variant. Sure it can! What are you talking about! std.variant has nothing to do with it! It works if T is hard coded, so it should work generically. What's the point of templates variables if

Re: Bug in D!!!

2017-08-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, August 30, 2017 20:47:12 EntangledQuanta via Digitalmars-d- learn wrote: > This is quite surprising! > > public struct S(T) > { > T s; > } > > > interface I > { > void Go(T)(S!T s); > > static final I New() > { > return new C(); > } > } > > abstract class A : I > { >

Re: Bug in D!!!

2017-08-30 Thread Kagamin via Digitalmars-d-learn
It can't work this way. You can try std.variant.

Re: Bug in D?!

2017-08-11 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Aug 11, 2017 at 11:34:04PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: > On Friday, 11 August 2017 at 22:43:02 UTC, Mr. Pib wrote: > > int and I should be able to append an int without having to worry > > about the value of the int. > > Appending an int to a string really ought

Re: Bug in D?!

2017-08-11 Thread Mr. Pib via Digitalmars-d-learn
On Friday, 11 August 2017 at 23:34:04 UTC, Adam D. Ruppe wrote: On Friday, 11 August 2017 at 22:43:02 UTC, Mr. Pib wrote: int and I should be able to append an int without having to worry about the value of the int. Appending an int to a string really ought to just be a type mismatch error.

Re: Bug in D?!

2017-08-11 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 11 August 2017 at 22:43:02 UTC, Mr. Pib wrote: int and I should be able to append an int without having to worry about the value of the int. Appending an int to a string really ought to just be a type mismatch error. We might be able to convince the leadership to do that too,

Re: Bug in D?!

2017-08-11 Thread Mr. Pib via Digitalmars-d-learn
On Friday, 11 August 2017 at 22:50:53 UTC, ketmar wrote: Mr. Pib wrote: Wow, that is pretty screwed up! I thought D was against implicit conversions that might cause problems? I'm passing an int and I should be able to append an int without having to worry about the value of the int.

Re: Bug in D?!

2017-08-11 Thread ketmar via Digitalmars-d-learn
Mr. Pib wrote: Wow, that is pretty screwed up! I thought D was against implicit conversions that might cause problems? I'm passing an int and I should be able to append an int without having to worry about the value of the int. Instead D chose to do something very strange, awkward, and error

Re: Bug in D?!

2017-08-11 Thread Mr. Pib via Digitalmars-d-learn
On Friday, 11 August 2017 at 04:17:32 UTC, ketmar wrote: Mr. Pib wrote: string Q(alias T, alias D)() { pragma(msg, T); pragma(msg, D); enum x = T~" = "~D~";"; pragma(msg, x); } mixin(Q!(`x`, 100)()); outputs, at compile time, x 100 x = d; there is no

Re: Bug in D?!

2017-08-10 Thread ketmar via Digitalmars-d-learn
Mr. Pib wrote: string Q(alias T, alias D)() { pragma(msg, T); pragma(msg, D); enum x = T~" = "~D~";"; pragma(msg, x); } mixin(Q!(`x`, 100)()); outputs, at compile time, x 100 x = d; there is no lowercase d. I did initially define Q as string Q(alias T, D)(D