www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - What is difference between std.signal and events?

reply "Uranuz" <neuranuz gmail.com> writes:
I have read some posts about new std.signal implementation. The 
last was this review thread: 
http://forum.dlang.org/thread/ujlhznaphepibgtpcoqz forum.dlang.org. 
What I still can't understand what is difference between signals 

has it's own extension to language to implement events). As far 

limitations. They can only be fired from owner's method. In JS 
events at my point of view are used to notify some input events 
or DOM changes. Borland C++ uses them to notify GUI events (in 
example button click). Is module called "signals" only for not 
interfere with OS IO events or is there some difference and 
reason?
Jan 16 2014
parent "Orvid King" <blah38621 gmail.com> writes:
On Thu, 16 Jan 2014 13:43:39 -0600, Uranuz <neuranuz gmail.com> wrote:

 I have read some posts about new std.signal implementation. The last was  
 this review thread:  
 http://forum.dlang.org/thread/ujlhznaphepibgtpcoqz forum.dlang.org. What  
 I still can't understand what is difference between signals and events  


 events are based on delegates but have some limitations. They can only  
 be fired from owner's method. In JS events at my point of view are used  
 to notify some input events or DOM changes. Borland C++ uses them to  
 notify GUI events (in example button click). Is module called "signals"  
 only for not interfere with OS IO events or is there some difference and  
 reason?
It's called signals because they are addressed by name, and are global in scope. (provided I've read the information on std.signal correctly) There implementation. (https://github.com/Orvid/std.event)
Jan 16 2014