std.range lockstep is not input range but opApply entity. Workarounds?

2012-12-29 Thread mist
I basically want to be able to do stuff like this: auto result = map!( (a, b) = a+b )( lockstep(range1, range2) ); Are there any standard short ways to wrap an input range around struct with opApply (which Lockstep is)? Also what about redesigning Lockstep as a proper range? I could do a

Re: std.range lockstep is not input range but opApply entity. Workarounds?

2012-12-29 Thread Simen Kjaeraas
On 2012-48-29 14:12, mist n...@none.none wrote: I basically want to be able to do stuff like this: auto result = map!( (a, b) = a+b )( lockstep(range1, range2) ); Are there any standard short ways to wrap an input range around struct with opApply (which Lockstep is)? Also what about

Re: std.range lockstep is not input range but opApply entity. Workarounds?

2012-12-29 Thread mist
Any objections to documentation update to cross-reference zip and lockstep to each other? Was not even searching for first one when found lockstep, huh. On Saturday, 29 December 2012 at 14:19:39 UTC, Simen Kjaeraas wrote: On 2012-48-29 14:12, mist n...@none.none wrote: I basically want to

Re: GtkD - missing DLLs in Gtk win32 runtime

2012-12-29 Thread Mike Wey
On 12/29/2012 01:45 AM, FG wrote: I'm trying out the latest GtkD binding. The lib has built without problems, some example programs also compile, but I can't run them. The Gtk-Runtime-3.6 archive provided at https://github.com/gtkd-developers/GtkD/downloads is missing several win32 DLL

Re: std.range lockstep is not input range but opApply entity. Workarounds?

2012-12-29 Thread Ali Çehreli
On 12/29/2012 06:19 AM, Simen Kjaeraas wrote: foreach (a; zip(A, B) ) { // Use a[0] and a[1] here. } There have been suggestions to better integrate tuples in the language, so in the future zip may have all the advantages of lockstep (and vice versa), but don't cross your fingers. Tuples

Re: structs are now lvalues - what is with auto ref?

2012-12-29 Thread Minas Mina
So when it will be fixed I will be able to write: void foo(auto ref Vector3 v); and it will pass copies or references depending on the situation?

Re: structs are now lvalues - what is with auto ref?

2012-12-29 Thread Namespace
On Saturday, 29 December 2012 at 18:43:37 UTC, Minas Mina wrote: So when it will be fixed I will be able to write: void foo(auto ref Vector3 v); and it will pass copies or references depending on the situation? Yes. The compiler generates the function for the specific situation. So you

Re: std.range lockstep is not input range but opApply entity. Workarounds?

2012-12-29 Thread mist
Not clever enough to expand like this though: map!( (a, b) = a+b )( zip(Range1, Range2) ); Using a = a[0]+a[1] is not that big deal though. On Saturday, 29 December 2012 at 17:58:55 UTC, Ali Çehreli wrote: On 12/29/2012 06:19 AM, Simen Kjaeraas wrote: foreach (a; zip(A, B) ) { // Use a[0]

Re: structs are now lvalues - what is with auto ref?

2012-12-29 Thread Jonathan M Davis
On Saturday, December 29, 2012 19:43:36 Minas Mina wrote: So when it will be fixed I will be able to write: void foo(auto ref Vector3 v); and it will pass copies or references depending on the situation? For templated functions, it currently generates either void foo(ref Vector3 v); or

opDollar fixed??

2012-12-29 Thread Era Scarecrow
Wasn't opDollar was fixed? Slices don't seem to be working... In one of my tests (can't duplicate here for some reason) using __dollar when it would see __dollar it complained about needing 'this' access. struct S { int[] x; this(int[] x) {this.x = x;} int opDollar() {return x.length;}

Re: opDollar fixed??

2012-12-29 Thread Era Scarecrow
Oh yes, dmd version 2.60, Windows 32bit version. I pretty sure it would propagate all versions.

Re: std.range lockstep is not input range but opApply entity. Workarounds?

2012-12-29 Thread Simen Kjaeraas
On 2012-52-29 20:12, mist n...@none.none wrote: Not clever enough to expand like this though: map!( (a, b) = a+b )( zip(Range1, Range2) ); Using a = a[0]+a[1] is not that big deal though. That oughta be doable. However, seeing as std.functional only contains unaryFun and binaryFun (dranges

Re: opDollar fixed??

2012-12-29 Thread Jonathan M Davis
On Saturday, December 29, 2012 23:15:34 Era Scarecrow wrote: Oh yes, dmd version 2.60, Windows 32bit version. I pretty sure it would propagate all versions. That would be your problem. It's not fixed in 2.060. It was fixed since then. Use the latest from git or the current beta. - Jonathan

Beta problems... 'this' pointer in union?

2012-12-29 Thread Era Scarecrow
On Saturday, 29 December 2012 at 23:58:49 UTC, Jonathan M Davis wrote: That would be your problem. It's not fixed in 2.060. It was fixed since then. Use the latest from git or the current beta. Hmm alright, I've installed the beta. New problems are creeping up curiously enough. There seems

Re: Beta problems... 'this' pointer in union?

2012-12-29 Thread Era Scarecrow
On Sunday, 30 December 2012 at 03:43:09 UTC, Jonathan M Davis wrote: For any bugs that you find in the beta, bring them up in the beta list and create bug reports for them in bugzilla: http://d.puremagic.com/issues Will do Looking at the code though, I'm shocked to see a function

Re: Beta problems... 'this' pointer in union?

2012-12-29 Thread Era Scarecrow
On Sunday, 30 December 2012 at 03:43:09 UTC, Jonathan M Davis wrote: For any bugs that you find in the beta, bring them up in the beta list and create bug reports for them in bugzilla: http://d.puremagic.com/issues Couldn't find a previous mention of this case.