Re: Asio Bindings?

2016-07-10 Thread Smoke Adams via Digitalmars-d-learn
On Wednesday, 8 June 2016 at 23:19:13 UTC, Andrej Mitrovic wrote: I do have (Steinberg) ASIO binding in D. The problem is I couldn't release the bindings. I've asked Steinberg if it was OK to release D bindings and they were strongly against it unfortunately (and this was over 3 years

Re: Get return type statically

2016-06-27 Thread Smoke Adams via Digitalmars-d-learn
I should point out also that this should be inheritable. Eventually I would like to create an algebra of SuperFunctions. e.g., SF3 = SF1 + SF2 is a new super function that combines the parameter list of SF1 and SF2 and unionizes their return type. Both functions are called by Do(which will

Re: Get return type statically

2016-06-27 Thread Smoke Adams via Digitalmars-d-learn
On Tuesday, 28 June 2016 at 01:41:03 UTC, "Smoke" Adams wrote: I have a type public class SuperFunction(T) { T t; return(T) Do() { return t(); } } where T is a delegate or function. First, I would like to be able to specify that this must be the case for SuperFunction so we can't pass

Get return type statically

2016-06-27 Thread Smoke Adams via Digitalmars-d-learn
I have a type public class SuperFunction(T) { T t; return(T) Do() { return t(); } } where T is a delegate or function. First, I would like to be able to specify that this must be the case for SuperFunction so we can't pass non-function/delegates for T. Second, How to specify the return

Re: Local fixed sized arrays

2016-06-27 Thread Smoke Adams via Digitalmars-d-learn
On Monday, 27 June 2016 at 22:56:35 UTC, Ali Çehreli wrote: On 06/27/2016 02:58 PM, Smoke Adams wrote: I'm in need of a way to create a local array that isn't GC'ed. It must be dynamic in the sense of setting the size at compile time but it will be used only in scope and only on structs.

Local fixed sized arrays

2016-06-27 Thread Smoke Adams via Digitalmars-d-learn
I'm in need of a way to create a local array that isn't GC'ed. It must be dynamic in the sense of setting the size at compile time but it will be used only in scope and only on structs. function x(int y) { bool[y] arr; arr ~= 3; } I care about slicing or anything but appending,

Diff between function and delegate

2016-06-27 Thread Smoke Adams via Digitalmars-d-learn
I have alias fnc = void function(Object); alias del = void delegate(); Does func avoid the GC? I am passing in this to Object so I don't technically need a delegate or a "context". I want to be sure that I'm actually gaining something here by doing this. I read somewhere that delegates only

Re: executeShell doesn't work but system does

2016-06-27 Thread Smoke Adams via Digitalmars-d-learn
On Sunday, 26 June 2016 at 16:02:18 UTC, ag0aep6g wrote: On 06/26/2016 05:37 PM, Smoke Adams wrote: [...] Unsolicited spelling correction: no 'i' in "deprecated". [...] `system` directly prints its output, `executeShell` returns it in a tuple with the status code. Maybe cls works by

executeShell doesn't work but system does

2016-06-26 Thread Smoke Adams via Digitalmars-d-learn
system("cls") works but executeShell doesn't. system is depreciated. What's going on? The docs say that it creates a new process. I simply want to clear the console!

Re: Get calling this, if exists

2016-06-24 Thread Smoke Adams via Digitalmars-d-learn
On Friday, 24 June 2016 at 15:35:57 UTC, Steven Schveighoffer wrote: On 6/24/16 11:15 AM, Smoke Adams wrote: On Friday, 24 June 2016 at 03:16:58 UTC, Meta wrote: On Friday, 24 June 2016 at 03:10:51 UTC, Mike Parker wrote: Oh, perhaps I misunderstood your question. Do you meant this: class

Re: Get calling this, if exists

2016-06-24 Thread Smoke Adams via Digitalmars-d-learn
On Friday, 24 June 2016 at 03:16:58 UTC, Meta wrote: On Friday, 24 June 2016 at 03:10:51 UTC, Mike Parker wrote: Oh, perhaps I misunderstood your question. Do you meant this: class Foo() { void bar() { Log(); } // Pass reference to Foo instance } void doSomething() { Log(); } // Null

Get calling this, if exists

2016-06-23 Thread Smoke Adams via Digitalmars-d-learn
Is there a type of __THIS__ construct similar to __FILE__ and __LINE__? Something that returns the current this ptr if it exists, null otherwise. Log(string filename = __FILE__, Object obj = __THIS__)() { // inspect obj and do stuff }