July 18, 2013
On Wednesday, 17 July 2013 at 16:06:14 UTC, David wrote:
> Thanks for your work, I'll try to test it the next days!

Thanks! I really appreciate it. The more real world use, the better and the sooner it can be moved to phobos! I am going to fix any found issues ASAP.
July 18, 2013
On Thursday, 18 July 2013 at 08:44:39 UTC, Robert wrote:
> On Thursday, 18 July 2013 at 01:26:17 UTC, E.S. Quinn wrote:
>> Out of curiosity, does this implementation support e.g. function literals or nested functions with connect()? The current phobos implementation only allows connecting class methods, and that's a limitation I've bumped up against quite a bit, especially when writing test code.
>
> I just improved the example given in the docs, see the code after comment '//Do some fancy stuff'. It should answer your question. ;-)
>
> https://vhios.dyndns.org/signal.html
>
> Best regards,
>
> Robert

Your site gives me an ssl certificate error with https and a 504 with http
July 18, 2013
> Your site gives me an ssl certificate error with https and a 504 with http

Yeah :-) It is only a home server, I did not pay for a proper certificate. Just ignore the security warning. I merely wanted to publish the documentation somewhere for easier access.

Best regards,

Robert

July 21, 2013
Ok, I came around to test it, finally.


A few things:
 * I don't like the separation between connect/strongConnect
 * I would like to bind a strongConnect to a class, if the class is gone
the strongConnect should be gone, too. E.g.
"window.single_key_down[JUMP].strongConnect({ physics.jump(); });"
physics is a class variable, this will blow up once the class holding it
is gone
 * I don't like the connect api for class-method connects, I write all
the time "window.on_mouse_pos.connect!"on_mouse_pos"(this);" (the this
is kinda annoying), doesn't something like signal.connect!(bla)() work,
with an alias template param?
 * Why is there no convenience class for Signal? Since the copy
constructor is disabled, I have to use a pointer, not a big deal, but a
class would be more convenient.


Other than that! Great job, I had not a single segfault so far (only 3
"starts" so far though :>)
July 23, 2013
On Thursday, 18 July 2013 at 11:31:06 UTC, Robert wrote:
>> Your site gives me an ssl certificate error with https and a 504 with http
>
> Yeah :-) It is only a home server, I did not pay for a proper certificate. Just ignore the security warning. I merely wanted to publish the documentation somewhere for easier access.
>
> Best regards,
>
> Robert

You can get free certificates from StartSSL.
July 25, 2013
> A few things:
>  * I don't like the separation between connect/strongConnect

It should be possible to make strongConnect just another overload of connect, but I chose to use another name because of the changed semantics. This way both the writer and the reader of the code have a clue what is going on. If strongConnect was also called connect, you could easily choose a strong connection by accident: sig.connect(&o.watch); // Oops strong connect.

>  * I would like to bind a strongConnect to a class, if the class is gone
> the strongConnect should be gone, too. E.g.
> "window.single_key_down[JUMP].strongConnect({ physics.jump(); });"
> physics is a class variable, this will blow up once the class holding it
> is gone

If physics is on the GC collected heap - nothing is going to blow up. The signal just keeps a strong ref to physics so the GC won't free it. If physics is for example reference counted or its lifetime is managed manually then it would blow up if you forget to call disconnect before destroying the object.

It would be easier if you used connect instead of strongConnect, this way the connection is dropped whenever physics gets destroyed, whatever the cause is. Also the signal won't keep it alive.

If you really mean a class by 'class variable' than it can't really be gone, except maybe for dynamic linking. In this case you would have to manage your connections yourself.

>  * I don't like the connect api for class-method connects, I write all
> the time "window.on_mouse_pos.connect!"on_mouse_pos"(this);" (the this
> is kinda annoying), doesn't something like signal.connect!(bla)() work,
> with an alias template param?

Unfortunately I don't see how this could work, but I am open for suggestions.

>  * Why is there no convenience class for Signal? Since the copy
> constructor is disabled, I have to use a pointer, not a big deal, but a
> class would be more convenient.

Not sure about this. It would just be a wrapper doing nothing except forwarding function calls, is this really better:

 auto sig = new SignalWrapper!(int)();
 void func(SignalWrapper!int sig) {}

than

 auto sig = new Signal!(int)();
 void func(Signal!int* sig) {}

?

> Other than that! Great job, I had not a single segfault so far (only 3
> "starts" so far though :>)

:-)
July 25, 2013
>
> You can get free certificates from StartSSL.

Thanks, that's actually cool :-) Unfortunately it does not work for my dyndns domain. (I can't register vhios.dyndns.org, only dyndns.org would be accepted)

July 28, 2013
On Sunday, 21 July 2013 at 11:24:42 UTC, David wrote:
> "window.single_key_down[JUMP].strongConnect({ physics.jump(); });"
> physics is a class variable, this will blow up once the class holding it
> is gone

You ask for the weak ref semantics, but as the name suggests, strongConnect has the strong ref semantics. In this case the closure keep a strong ref to the object with the physics field and the signal keeps a strong ref to the closure, so the window keeps a strong ref to the object, so it won't be collected.
July 28, 2013
Am 28.07.2013 18:39, schrieb Kagamin:
> On Sunday, 21 July 2013 at 11:24:42 UTC, David wrote:
>> "window.single_key_down[JUMP].strongConnect({ physics.jump(); });"
>> physics is a class variable, this will blow up once the class holding it
>> is gone
> 
> You ask for the weak ref semantics, but as the name suggests, strongConnect has the strong ref semantics. In this case the closure keep a strong ref to the object with the physics field and the signal keeps a strong ref to the closure, so the window keeps a strong ref to the object, so it won't be collected.

Yeah I noticed that shortly after I wrote that... the "connect" method should just work.
1 2
Next ›   Last »