Home » U++ Library support » U++ Core » <<= and <<
Re: <<= and << [message #12958 is a reply to message #12957] |
Fri, 30 November 2007 13:52   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
waxblood wrote on Fri, 30 November 2007 07:13 |
Quote: |
<<= sets the WhenAction callback
<< adds a new callback to existing one; if there were any callbacks before assigned, they will be called as well.
In fact, "<<" is sort of experiment and is very rarely used
|
Reading code snippets in documentation '<<=' is always used instead of <<, but isn't the '<<' behaviour much more natural than the first one? Writing code with '<<' allows the programmer to modify callbacks stack of ancestor classes freely being at least a little more confident that those callbacks will always be executed before any one other callbacks in derived classes.
Using always '<<=' precludes this possibility.
I think it would be useful to develop plugin-oriented programs, too.
|
Interesting thoughts, yes, something like this is definitely possible path.
I guess using "<<=" is a result of two issues:
1. "<<=" existed long before "<<"
2. In real world applications, single action per callback is simply 99% of cases.
Quote: |
I'm wondering, given the fact quite nobody uses the '<<' form, would it be possible to convert the '<<=' behaviour to '<<'?
|
Well, once again interesting idea... But here I am a bit afraid about changed semantics.
Mirek
|
|
|
 |
|
<<= and <<
By: Balage on Sun, 17 December 2006 23:12
|
 |
|
Re: <<= and <<
By: mirek on Sun, 17 December 2006 23:48
|
 |
|
Re: <<= and <<
By: Balage on Sun, 17 December 2006 23:57
|
 |
|
Re: <<= and <<
By: mirek on Mon, 18 December 2006 00:16
|
 |
|
Re: <<= and <<
By: waxblood on Fri, 30 November 2007 13:13
|
 |
|
Re: <<= and <<
By: mirek on Fri, 30 November 2007 13:52
|
 |
|
Re: <<= and <<
By: waxblood on Thu, 06 December 2007 23:44
|
 |
|
Re: <<= and <<
By: mirek on Fri, 07 December 2007 09:25
|
 |
|
Re: <<= and <<
By: waxblood on Fri, 07 December 2007 10:12
|
 |
|
Re: <<= and <<
By: mirek on Sat, 08 December 2007 07:17
|
Goto Forum:
Current Time: Mon Apr 28 23:14:42 CEST 2025
Total time taken to generate the page: 0.00891 seconds
|