Re: Bug with writeln?

2018-09-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, September 6, 2018 1:05:03 PM MDT Steven Schveighoffer via Digitalmars-d-learn wrote: > On 9/6/18 2:52 PM, Jonathan M Davis wrote: > > On Thursday, September 6, 2018 12:21:24 PM MDT Steven Schveighoffer via > > > > Digitalmars-d-learn wrote: > >> On 9/6/18 12:55 PM, Jonathan M Davis

Re: Bug with writeln?

2018-09-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/6/18 2:52 PM, Jonathan M Davis wrote: On Thursday, September 6, 2018 12:21:24 PM MDT Steven Schveighoffer via Digitalmars-d-learn wrote: On 9/6/18 12:55 PM, Jonathan M Davis wrote: It's not a bug in writeln. Any time that a range is copied, you must not do _anything_ else with the

Re: Bug with writeln?

2018-09-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, September 6, 2018 12:21:24 PM MDT Steven Schveighoffer via Digitalmars-d-learn wrote: > On 9/6/18 12:55 PM, Jonathan M Davis wrote: > > On Thursday, September 6, 2018 2:40:08 AM MDT Saurabh Das via > > Digitalmars-d-> > > learn wrote: > >> Is this a bug with writeln? > >> > >> void

Re: Bug with writeln?

2018-09-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/6/18 12:55 PM, Jonathan M Davis wrote: On Thursday, September 6, 2018 2:40:08 AM MDT Saurabh Das via Digitalmars-d- learn wrote: Is this a bug with writeln? void main() { import std.stdio, std.range, std.algorithm; auto a1 = sort([1,3,5,4,2]); auto a2 = sort([9,8,9]);

Re: Bug with writeln?

2018-09-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, September 6, 2018 2:40:08 AM MDT Saurabh Das via Digitalmars-d- learn wrote: > Is this a bug with writeln? > > void main() > { > import std.stdio, std.range, std.algorithm; > > auto a1 = sort([1,3,5,4,2]); > auto a2 = sort([9,8,9]); > auto a3 = sort([5,4,5,4]); > >

Re: Bug with writeln?

2018-09-06 Thread Simen Kjærås via Digitalmars-d-learn
On Thursday, 6 September 2018 at 09:06:21 UTC, Simen Kjærås wrote: On Thursday, 6 September 2018 at 08:40:08 UTC, Saurabh Das wrote: Is this a bug with writeln? Yup. What happens is writeln destructively iterates over b[i]. Since b[i] is a forward range, this shouldn't be done

Re: Bug with writeln?

2018-09-06 Thread Simen Kjærås via Digitalmars-d-learn
On Thursday, 6 September 2018 at 08:40:08 UTC, Saurabh Das wrote: Is this a bug with writeln? Yup. What happens is writeln destructively iterates over b[i]. Since b[i] is a forward range, this shouldn't be done destructively. Instead, a copy should be made using b[i].save, somewhere deep in

Re: Bug? ElementType fails if element type is const

2017-10-09 Thread drug via Digitalmars-d-learn
oops, it was my fault. sorry for noise. my apologies to ElementType ))

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

Re: Bug in gtkd?

2017-08-05 Thread Mike Wey via Digitalmars-d-learn
On 03-08-17 23:11, Johnson Jones wrote: On Thursday, 3 August 2017 at 21:00:17 UTC, Mike Wey wrote: On 03-08-17 22:40, Johnson Jones wrote: Ok, so, I linked the gtk to the msys gtk that I installed before when trying to get glade to work and it worked! seems that msys is much more up to date

Re: Bug in gtkd?

2017-08-03 Thread Johnson Jones via Digitalmars-d-learn
On Thursday, 3 August 2017 at 21:00:17 UTC, Mike Wey wrote: On 03-08-17 22:40, Johnson Jones wrote: Ok, so, I linked the gtk to the msys gtk that I installed before when trying to get glade to work and it worked! seems that msys is much more up to date than anything else as it just works(I

Re: Bug in gtkd?

2017-08-03 Thread Mike Wey via Digitalmars-d-learn
On 03-08-17 22:40, Johnson Jones wrote: Ok, so, I linked the gtk to the msys gtk that I installed before when trying to get glade to work and it worked! seems that msys is much more up to date than anything else as it just works(I need to remember than in the future). The problem I see is

Re: Bug in gtkd?

2017-08-03 Thread Johnson Jones via Digitalmars-d-learn
On Thursday, 3 August 2017 at 15:11:46 UTC, Mike Wey wrote: On 03-08-17 05:00, Johnson Jones wrote: On Wednesday, 2 August 2017 at 14:51:45 UTC, Mike Wey wrote: On 02-08-17 08:04, Johnson Jones wrote: Ok, Using msys I was able to get glade 3.20 running. Maybe that will fix everything.

Re: Bug in gtkd?

2017-08-03 Thread Johnson Jones via Digitalmars-d-learn
On Thursday, 3 August 2017 at 15:11:46 UTC, Mike Wey wrote: On 03-08-17 05:00, Johnson Jones wrote: On Wednesday, 2 August 2017 at 14:51:45 UTC, Mike Wey wrote: On 02-08-17 08:04, Johnson Jones wrote: Ok, Using msys I was able to get glade 3.20 running. Maybe that will fix everything.

Re: Bug in gtkd?

2017-08-03 Thread Johnson Jones via Digitalmars-d-learn
On Thursday, 3 August 2017 at 15:11:46 UTC, Mike Wey wrote: On 03-08-17 05:00, Johnson Jones wrote: On Wednesday, 2 August 2017 at 14:51:45 UTC, Mike Wey wrote: On 02-08-17 08:04, Johnson Jones wrote: Ok, Using msys I was able to get glade 3.20 running. Maybe that will fix everything.

Re: Bug in gtkd?

2017-08-03 Thread Mike Wey via Digitalmars-d-learn
On 03-08-17 05:00, Johnson Jones wrote: On Wednesday, 2 August 2017 at 14:51:45 UTC, Mike Wey wrote: On 02-08-17 08:04, Johnson Jones wrote: Ok, Using msys I was able to get glade 3.20 running. Maybe that will fix everything. Great, unfortunately "Use msys2" seems to be the official way to

Re: Bug in gtkd?

2017-08-02 Thread Johnson Jones via Digitalmars-d-learn
On Thursday, 3 August 2017 at 03:00:02 UTC, Johnson Jones wrote: On Wednesday, 2 August 2017 at 14:51:45 UTC, Mike Wey wrote: On 02-08-17 08:04, Johnson Jones wrote: Ok, Using msys I was able to get glade 3.20 running. Maybe that will fix everything. Great, unfortunately "Use msys2" seems to

Re: Bug in gtkd?

2017-08-02 Thread Johnson Jones via Digitalmars-d-learn
On Wednesday, 2 August 2017 at 14:51:45 UTC, Mike Wey wrote: On 02-08-17 08:04, Johnson Jones wrote: Ok, Using msys I was able to get glade 3.20 running. Maybe that will fix everything. Great, unfortunately "Use msys2" seems to be the official way to install anything GTK related on windows.

Re: Bug in gtkd?

2017-08-02 Thread Johnson Jones via Digitalmars-d-learn
On Wednesday, 2 August 2017 at 14:51:45 UTC, Mike Wey wrote: On 02-08-17 08:04, Johnson Jones wrote: Ok, Using msys I was able to get glade 3.20 running. Maybe that will fix everything. Great, unfortunately "Use msys2" seems to be the official way to install anything GTK related on windows.

Re: Bug in gtkd?

2017-08-02 Thread Mike Wey via Digitalmars-d-learn
On 02-08-17 08:04, Johnson Jones wrote: Ok, Using msys I was able to get glade 3.20 running. Maybe that will fix everything. Great, unfortunately "Use msys2" seems to be the official way to install anything GTK related on windows. -- Mike Wey

Re: Bug in gtkd?

2017-08-02 Thread Johnson Jones via Digitalmars-d-learn
Ok, Using msys I was able to get glade 3.20 running. Maybe that will fix everything.

Re: Bug in gtkd?

2017-08-01 Thread Johnson Jones via Digitalmars-d-learn
On Tuesday, 1 August 2017 at 20:18:19 UTC, Mike Wey wrote: On 01-08-17 21:44, Johnson Jones wrote: On Tuesday, 1 August 2017 at 15:20:08 UTC, Mike Wey wrote: On 01-08-17 05:53, Johnson Jones wrote: GtkD is currently based on GTK 3 the properties it complains about were removed in GTK 3.0.

Re: Bug in gtkd?

2017-08-01 Thread Mike Wey via Digitalmars-d-learn
On 01-08-17 21:44, Johnson Jones wrote: On Tuesday, 1 August 2017 at 15:20:08 UTC, Mike Wey wrote: On 01-08-17 05:53, Johnson Jones wrote: GtkD is currently based on GTK 3 the properties it complains about were removed in GTK 3.0. Which version of glade are you using? The latest: Glade

Re: Bug in gtkd?

2017-08-01 Thread Johnson Jones via Digitalmars-d-learn
On Tuesday, 1 August 2017 at 15:20:08 UTC, Mike Wey wrote: On 01-08-17 05:53, Johnson Jones wrote: GtkD is currently based on GTK 3 the properties it complains about were removed in GTK 3.0. Which version of glade are you using? The latest: Glade 3.8.5

Re: Bug in gtkd?

2017-08-01 Thread Mike Wey via Digitalmars-d-learn
On 01-08-17 05:53, Johnson Jones wrote: GtkD is currently based on GTK 3 the properties it complains about were removed in GTK 3.0. Which version of glade are you using? -- Mike Wey

Re: Bug or not? Statics inside blocks

2017-07-28 Thread ag0aep6g via Digitalmars-d-learn
On 07/29/2017 03:54 AM, Cecil Ward wrote: Is it my bug, or a compiler bug? (name clash at link-time?): void main() { { immutable static dstring str1 = "a"; } { immutable static dstring str1 = "b"; } }

Re: Bug or not? Statics inside blocks

2017-07-28 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, July 29, 2017 1:54:29 AM MDT Cecil Ward via Digitalmars-d-learn wrote: > The snippet below failed to compile (I think) in the latest DMD - > but I can't see the error message in the web-based editor at > dlang.org. It certainly failed to compile under GDC 5.2.0 when > tried out using

Re: Bug or not? Statics inside blocks

2017-07-28 Thread Cecil Ward via Digitalmars-d-learn
On Saturday, 29 July 2017 at 01:54:29 UTC, Cecil Ward wrote: The snippet below failed to compile (I think) in the latest DMD - but I can't see the error message in the web-based editor at dlang.org. It certainly failed to compile under GDC 5.2.0 when tried out using d.godbolt.org. (Is there

Re: Bug in File.byRecord ?

2017-07-26 Thread Ali Çehreli via Digitalmars-d-learn
On 07/26/2017 04:51 AM, closescreen wrote: > I have a file with empty lines: 2,3 and 5,6 > > filename.csv (with linenumbers for better view in this message) > 1>Joe,Carpenter,30 > 2> > 3> > 4>Fred,Blacksmith,40 > 5> > 6> > > Now, if I run: > rdmd >

Re: bug in foreach continue

2017-03-24 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Mar 23, 2017 at 05:11:49PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: > On Thursday, 23 March 2017 at 00:39:56 UTC, H. S. Teoh wrote: > > I'm still working on that. :-) > > Hey, can you at least put scare quotes around "static foreach" each > time it is used? There's no such

Re: bug in foreach continue

2017-03-23 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 23 March 2017 at 00:39:56 UTC, H. S. Teoh wrote: I'm still working on that. :-) Hey, can you at least put scare quotes around "static foreach" each time it is used? There's no such thing as static foreach and while we might call foreach over a typetuple "static", it isn't a

Re: bug in foreach continue

2017-03-22 Thread Ali Çehreli via Digitalmars-d-learn
On 03/22/2017 05:39 PM, H. S. Teoh via Digitalmars-d-learn wrote: > the article is turning out to be quite a bit longer I said "book"; didn't I? :) Ali

Re: bug in foreach continue

2017-03-22 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Mar 22, 2017 at 11:12:06PM +, Jesse Phillips via Digitalmars-d-learn wrote: > On Friday, 17 March 2017 at 19:05:20 UTC, H. S. Teoh wrote: > > There are actually (at least) TWO distinct phases of compilation > > that are conventionally labelled "compile time": > > > > 1) Template

Re: bug in foreach continue

2017-03-22 Thread Jesse Phillips via Digitalmars-d-learn
On Friday, 17 March 2017 at 19:05:20 UTC, H. S. Teoh wrote: There are actually (at least) TWO distinct phases of compilation that are conventionally labelled "compile time": 1) Template expansion / AST manipulation, and: 2) CTFE (compile-time function evaluation). This was an awesome

Re: bug in foreach continue

2017-03-21 Thread Stefan Koch via Digitalmars-d-learn
On Friday, 17 March 2017 at 19:05:20 UTC, H. S. Teoh wrote: There are actually (at least) TWO distinct phases of compilation that are conventionally labelled "compile time": 1) Template expansion / AST manipulation, and: 2) CTFE (compile-time function evaluation). [ ... ] Template

Re: bug in foreach continue

2017-03-18 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 19 March 2017 at 00:18:15 UTC, H. S. Teoh wrote: Haha, I don't think I'm up for writing a book... and I don't really keep a blog either. But perhaps a writeup on wiki.dlang.org is in order. This particular topic, I think, is something somebody *should* write about, because it

Re: bug in foreach continue

2017-03-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, March 18, 2017 17:18:15 H. S. Teoh via Digitalmars-d-learn wrote: > On Fri, Mar 17, 2017 at 02:52:39PM -0700, Ali Çehreli via Digitalmars-d- learn wrote: > > On 03/17/2017 12:05 PM, H. S. Teoh via Digitalmars-d-learn wrote: > > > 1) Template expansion / AST manipulation, and: > > > >

Re: bug in foreach continue

2017-03-18 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Mar 17, 2017 at 02:52:39PM -0700, Ali Çehreli via Digitalmars-d-learn wrote: > On 03/17/2017 12:05 PM, H. S. Teoh via Digitalmars-d-learn wrote: > > > 1) Template expansion / AST manipulation, and: > > > > 2) CTFE (compile-time function evaluation). > > > > Not clearly understanding

Re: bug in foreach continue

2017-03-17 Thread Hussien via Digitalmars-d-learn
On Friday, 17 March 2017 at 19:05:20 UTC, H. S. Teoh wrote: On Fri, Mar 17, 2017 at 03:14:08PM +, Hussien via Digitalmars-d-learn wrote: [...] [...] This appears to be yet another case of the term "compile-time" causing confusion, because it's actually an ambiguous term. I actually

Re: bug in foreach continue

2017-03-17 Thread Ali Çehreli via Digitalmars-d-learn
On 03/17/2017 12:05 PM, H. S. Teoh via Digitalmars-d-learn wrote: 1) Template expansion / AST manipulation, and: 2) CTFE (compile-time function evaluation). Not clearly understanding the distinction between the two often leads to confusion and frustration at why the compiler isn't doing "what

Re: bug in foreach continue

2017-03-17 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Mar 17, 2017 at 03:14:08PM +, Hussien via Digitalmars-d-learn wrote: [...] > What I am talking about is > > how the statement > > static if (x) continue; > pragma(msg, "called"); > > vs > > static if (x) { } else > pragma(msg, "not called"); > > > They are both semantically

Re: bug in foreach continue

2017-03-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 17 March 2017 at 15:14:08 UTC, Hussien wrote: What I am talking about is If you want to add a new feature, `static foreach`, that has static continue and static break, I can get behind that, but that's a new feature, not a bug in the existing feature. You think it is something it

Re: bug in foreach continue

2017-03-17 Thread Hussien via Digitalmars-d-learn
On Friday, 17 March 2017 at 14:27:25 UTC, Adam D. Ruppe wrote: On Friday, 17 March 2017 at 13:53:58 UTC, Hussien wrote: Yes, but you have a nested foreach loop. One runtime and one compile time. The break goes with the runtime loop... but NORMAL programming logic tells us that the break goes

Re: bug in foreach continue

2017-03-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 17 March 2017 at 13:53:58 UTC, Hussien wrote: Yes, but you have a nested foreach loop. One runtime and one compile time. The break goes with the runtime loop... but NORMAL programming logic tells us that the break goes with the loop that it exists in. It did. It broke the loop

Re: bug in foreach continue

2017-03-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 17 March 2017 at 13:10:23 UTC, Jonathan M Davis wrote: it looks like break and continue _are_ used at compile time, since it prints They are working exactly the same way as any other loop. The fact that it is unrolled and the dead code removed from the binary is an implementation

Re: bug in foreach continue

2017-03-17 Thread Hussien via Digitalmars-d-learn
On Friday, 17 March 2017 at 13:10:23 UTC, Jonathan M Davis wrote: On Friday, March 17, 2017 11:53:41 Michael via Digitalmars-d-learn wrote: On Friday, 17 March 2017 at 11:30:48 UTC, Jonathan M Davis wrote: > On Friday, March 17, 2017 01:55:19 Hussien via > Digitalmars-d-learn wrote: > > I

Re: bug in foreach continue

2017-03-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, March 17, 2017 11:53:41 Michael via Digitalmars-d-learn wrote: > On Friday, 17 March 2017 at 11:30:48 UTC, Jonathan M Davis wrote: > > On Friday, March 17, 2017 01:55:19 Hussien via > > Digitalmars-d-learn wrote: > > > > I tend to agree with this. If the foreach is static, and > >

Re: bug in foreach continue

2017-03-17 Thread Michael via Digitalmars-d-learn
On Friday, 17 March 2017 at 11:30:48 UTC, Jonathan M Davis wrote: On Friday, March 17, 2017 01:55:19 Hussien via Digitalmars-d-learn wrote: I tend to agree with this. If the foreach is static, and continue and break are just going to be ignored, then they should just be illegal. Allowing

Re: bug in foreach continue

2017-03-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, March 17, 2017 01:55:19 Hussien via Digitalmars-d-learn wrote: > On Friday, 17 March 2017 at 01:41:47 UTC, Adam D. Ruppe wrote: > > On Friday, 17 March 2017 at 01:34:52 UTC, Hussien wrote: > >> Seems like continue needs to be static aware. > > > > That's not a bug, pragma is triggered

Re: bug in foreach continue

2017-03-17 Thread Daniel Kozak via Digitalmars-d-learn
Dne 17.3.2017 v 02:34 Hussien via Digitalmars-d-learn napsal(a): foreach (y; aliasSeqOf!["a", "b", "c"]) { static if (y == "a") { } else pragma(msg, y); } works but foreach (y; aliasSeqOf!["a", "b", "c"]) { static if (y == "a") continue pragma(msg, y); } fails. Seems like continue needs to

Re: bug in foreach continue

2017-03-16 Thread Hussien via Digitalmars-d-learn
On Friday, 17 March 2017 at 01:41:47 UTC, Adam D. Ruppe wrote: On Friday, 17 March 2017 at 01:34:52 UTC, Hussien wrote: Seems like continue needs to be static aware. That's not a bug, pragma is triggered when the code is *compiled*, not when it is run. The code is compiled, even if it is

Re: bug in foreach continue

2017-03-16 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 17 March 2017 at 01:34:52 UTC, Hussien wrote: Seems like continue needs to be static aware. That's not a bug, pragma is triggered when the code is *compiled*, not when it is run. The code is compiled, even if it is skipped over by a continue.

Re: Bug in generator

2017-01-30 Thread ag0aep6g via Digitalmars-d-learn
On 01/30/2017 11:58 AM, Profile Anaysis wrote: Also, if one tries to create a global generator an error about PAGESIZE not being a compile time value is given. That means you can't initialize it statically, because PAGESIZE is not known statically. But you can have a global (module scope,

Re: Bug in generator

2017-01-30 Thread ag0aep6g via Digitalmars-d-learn
On 01/30/2017 11:58 AM, Profile Anaysis wrote: the code from https://dlang.org/library/std/concurrency/generator.html gives a seg fault at the end. import std.concurrency; import std.stdio; void main() { auto tid = spawn( { while (true) {

Re: Bug in documentation or misunderstanding it?

2017-01-27 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jan 26, 2017 at 06:47:21PM +, Suliman via Digitalmars-d-learn wrote: > On Thursday, 26 January 2017 at 18:42:29 UTC, Suliman wrote: > > On Thursday, 26 January 2017 at 17:52:24 UTC, H. S. Teoh wrote: > > > On Thu, Jan 26, 2017 at 05:38:59PM +, Suliman via > > > Digitalmars-d-learn

Re: Bug in documentation or misunderstanding it?

2017-01-26 Thread Suliman via Digitalmars-d-learn
On Thursday, 26 January 2017 at 18:42:29 UTC, Suliman wrote: On Thursday, 26 January 2017 at 17:52:24 UTC, H. S. Teoh wrote: On Thu, Jan 26, 2017 at 05:38:59PM +, Suliman via Digitalmars-d-learn wrote: I read docs and can't understand what's wrong. Or I am do not understand it, or there is

Re: Bug in documentation or misunderstanding it?

2017-01-26 Thread Suliman via Digitalmars-d-learn
On Thursday, 26 January 2017 at 17:52:24 UTC, H. S. Teoh wrote: On Thu, Jan 26, 2017 at 05:38:59PM +, Suliman via Digitalmars-d-learn wrote: I read docs and can't understand what's wrong. Or I am do not understand it, or there is come mistake. Let's look at function

Re: Bug in documentation or misunderstanding it?

2017-01-26 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jan 26, 2017 at 05:38:59PM +, Suliman via Digitalmars-d-learn wrote: > I read docs and can't understand what's wrong. Or I am do not understand it, > or there is come mistake. > > Let's look at function https://dlang.org/phobos/std_stdio.html#.File.byLine > > auto byLine(Terminator =

Re: Bug in documentation or misunderstanding it?

2017-01-26 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 26 January 2017 at 17:38:59 UTC, Suliman wrote: I read docs and can't understand what's wrong. Or I am do not understand it, or there is come mistake. [...] You have to import typecons.

Re: Bug after update to 2.072?

2016-11-07 Thread ag0aep6g via Digitalmars-d-learn
On 11/07/2016 06:18 PM, Alex wrote: On Monday, 7 November 2016 at 17:12:32 UTC, Alex wrote: dmd -c -of./app.o -debug -g -gc -O -profile -w ./app.d -vcolumns dmd -of./app ./app.o -g -gc Knowing this, I tried to find the option which does the difference. This was the profile option. So, if I

Re: Bug after update to 2.072?

2016-11-07 Thread Alex via Digitalmars-d-learn
On Monday, 7 November 2016 at 16:55:29 UTC, Alex wrote: Ok... Another point is, that I'm using dub and trying compiling my app directly by dmd does not yield the error. So, I have to attach the compiling commands, which I see, when tried dub build --force -v dmd -c -of./app.o -debug -g -gc

<    1   2   3   4   5   >