Re: Chaining a dynamic number of Ranges

2012-07-21 Thread Jonathan M Davis
On Sunday, July 22, 2012 02:34:47 Enerqi wrote: > Ok thanks! I was hoping to avoid making a copy of the arrays, > which I think std.array.join does, when treating them as a single > array range. Wishful thinking perhaps :) It works as long as you don't need capabilities that the new range doesn't

Re: Chaining a dynamic number of Ranges

2012-07-21 Thread Enerqi
Ok thanks! I was hoping to avoid making a copy of the arrays, which I think std.array.join does, when treating them as a single array range. Wishful thinking perhaps :) On Saturday, 21 July 2012 at 20:18:25 UTC, Jonathan M Davis wrote: On Saturday, July 21, 2012 21:47:19 Enerqi wrote: Thanks!

Re: ~= call copy ctor?

2012-07-21 Thread Ali Çehreli
First, my earlier writeln("exit main"); wasn't achieving much without putting everything before it in a scope (like it is below). On 07/21/2012 03:12 PM, Namespace wrote: > Cool. Any idea how to fix it? > Check whether this._ptr! is null && *this._ptr! is null does not help. > Although I'm just

Re: ~= call copy ctor?

2012-07-21 Thread Namespace
Cool. Any idea how to fix it? Check whether this._ptr! is null && *this._ptr! is null does not help. Although I'm just experimenting, but it would be nice to have a solution.

Re: ~= call copy ctor?

2012-07-21 Thread Ali Çehreli
On 07/21/2012 01:41 PM, Namespace wrote: Ok. I hope it will not take months. :/ BTW: I have a new strange behaviour by experiementing with structs. This code http://dpaste.dzfl.pl/new#top works fine, as long as i don't do _any_ operation after line 91. If i activate one of the out comment opera

Re: ~= call copy ctor?

2012-07-21 Thread Namespace
I'm not sure if it's a bug or my code is nonsense. ;)

Re: ~= call copy ctor?

2012-07-21 Thread Jonathan M Davis
On Saturday, July 21, 2012 22:41:10 Namespace wrote: > Ok. I hope it will not take months. :/ Well, it's looking like it's going to take at least a month or two, but we'll see. It'll likely depend on how quickly Walter can complete what he's working on. He could have it done by the end of the mo

Re: ~= call copy ctor?

2012-07-21 Thread Namespace
On Saturday, 21 July 2012 at 20:48:16 UTC, Namespace wrote: I have tried various compiler flag combinations, even without. But it still crashes. Seems to be a Windows bug. I'm stupid... I only compiles but not save my paste. Here is the Code: http://dpaste.dzfl.pl/d385c56b

Re: ~= call copy ctor?

2012-07-21 Thread Namespace
I have tried various compiler flag combinations, even without. But it still crashes. Seems to be a Windows bug.

Re: ~= call copy ctor?

2012-07-21 Thread Namespace
Ok. I hope it will not take months. :/ BTW: I have a new strange behaviour by experiementing with structs. This code http://dpaste.dzfl.pl/new#top works fine, as long as i don't do _any_ operation after line 91. If i activate one of the out comment operations or something else, the program work

Re: ~= call copy ctor?

2012-07-21 Thread Jonathan M Davis
On Saturday, July 21, 2012 22:18:40 Namespace wrote: > That's great. Hope 2.060 fixes many errors, especially in structs. > BTW: When comes 20060? I thought dmd versions come in cycles of > 2-3 months? Usually, they do, but Walter got caught up in working on COFF support for Windows and there's n

Re: Chaining a dynamic number of Ranges

2012-07-21 Thread Jonathan M Davis
On Saturday, July 21, 2012 13:18:15 Jonathan M Davis wrote: > And it would never work with the separator, since the separator > would be in the range multiple times, and sorting it could really mess it Actually, I take that back. Since the separator is a forward range, it could probably be done.

Re: ~= call copy ctor?

2012-07-21 Thread Namespace
That's great. Hope 2.060 fixes many errors, especially in structs. BTW: When comes 20060? I thought dmd versions come in cycles of 2-3 months?

Re: Chaining a dynamic number of Ranges

2012-07-21 Thread Jonathan M Davis
On Saturday, July 21, 2012 21:47:19 Enerqi wrote: > Thanks! That does join up the arrays as I'd like. > An issue remaining is that, unlike with the chain function, I > can't sort the output of the joiner function. > > Error: template instance std.algorithm.sort!("a < > b",cast(SwapStrategy)0,Resul

Re: Parameter specialization

2012-07-21 Thread Eyyub
Okay ! The spec' should be more explicit, I'm sure that I'm not the first who asked this question ! Thanks Guys,

Re: ~= call copy ctor?

2012-07-21 Thread Kenji Hara
On Friday, 20 July 2012 at 16:02:18 UTC, Namespace wrote: If i @disable the postblit i get a strange behaviour: [code] struct Test { public: int _id; this(int i) { _id = i; writeln("CTOR"); } @disable this(this);

Re: Chaining a dynamic number of Ranges

2012-07-21 Thread Enerqi
Thanks! That does join up the arrays as I'd like. An issue remaining is that, unlike with the chain function, I can't sort the output of the joiner function. Error: template instance std.algorithm.sort!("a < b",cast(SwapStrategy)0,Result) error instantiating Seems the return type of joiner doe

Re: Problem: handling a function dependent on release mode.

2012-07-21 Thread Namespace
On Saturday, 21 July 2012 at 16:05:24 UTC, Jacob Carlborg wrote: On 2012-07-20 23:47, Namespace wrote: Maybe something like that? void alCheck(lazy void Func, string filename = __FILE__, uint line = __LINE__) { Func(); debug { alCheckError(filename, line); } } If "filena

Re: Chaining a dynamic number of Ranges

2012-07-21 Thread Nathan M. Swan
On Saturday, 21 July 2012 at 16:42:50 UTC, Enerqi wrote: Hello I'm playing around with my first D program and can't figure out a way to chain a dynamic number of ranges. In this example I'm trying to chain a two dimensional array into effectively a one dimensional array, so I can later sort i

Chaining a dynamic number of Ranges

2012-07-21 Thread Enerqi
Hello I'm playing around with my first D program and can't figure out a way to chain a dynamic number of ranges. In this example I'm trying to chain a two dimensional array into effectively a one dimensional array, so I can later sort it as one sequence. import std.algorithm; impor

Re: Problem: handling a function dependent on release mode.

2012-07-21 Thread Jacob Carlborg
On 2012-07-20 23:47, Namespace wrote: Maybe something like that? void alCheck(lazy void Func, string filename = __FILE__, uint line = __LINE__) { Func(); debug { alCheckError(filename, line); } } If "filename" and "line" is template parameters they will get the defau

Re: More WinAPI problems

2012-07-21 Thread Kagamin
INPUT doesn't match C declaration and probably has wrong size. Also to properly handle errors first check return code and then last error.

Re: WinAPI LowLevel Keyboard Hooks

2012-07-21 Thread torhu
On 19.07.2012 13:45, DLimited wrote: Hello everyone, I had this great idea of writing a Program that intercepts all keyboard presses and modifies them in certain cases. I want to use it as some kind of global makro program to run in the background and for example allow me to easily post unicode

functions that do not sleep and recovery points

2012-07-21 Thread akaz
Hi, In Linux kernel programming, there are some parts that are not allowed to sleep (to be rescheduled). For example: interrupt handlers, softirqs and tasklets. Using functions that can sleep (for example: malloc, semaphores, regular mutexes - unlike spin_locks, etc.) is forbidden inside

Re: Parameter specialization

2012-07-21 Thread Artur Skawina
On 07/21/12 08:29, Ali Çehreli wrote: > On 07/20/2012 06:47 PM, Eyyub wrote: >> I have a question about the semantic of parameter >> specialization(TemplateTypeParameterSpecialization) >> In this following code, there are 2 forms of the same function 'add' : >> >> >> T add(T, U : T) (T a, U b) //d