Home » U++ Library support » U++ Core » <<= and <<
Re: <<= and << [message #13046 is a reply to message #12958] |
Thu, 06 December 2007 23:44   |
waxblood
Messages: 95 Registered: January 2007
|
Member |
|
|
Quote: |
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
|
Well, in fact that wasn't a great idea. Here's some better thought:
Quote: | 2. In real world applications, single action per callback is simply 99% of cases.
|
I had the suspect of a similar percentage, but now that it is confirmed I think it's time to plan a switch to the '<<' form. I think these should be the steps to follow:
a) fix the following problem:
writing
somebutton << THISBACK(Press) <<= THISBACK(Press2);
results in a compiling problem, which is right since adding callback Press to just replace it with Press2 with the <<= doesn't make sense. But, if you write
somebutton <<= THISBACK(Press) << THISBACK(Press2);
IMO the compiler shoudn't complain, since replacing callbacks stack with Press and adding then Press2 seems a logic step. In fact the compiler doesn't complain, but at runtime you get no results when pressing somebutton. If this is not a bug, is a bad incongruence at least.
b) start to write new Ultimate++ code with '<<' form.
c) change examples,reference and tutorials (I think this step should be possibly made in one single pass, to avoid generating confusion among users should be just a matter of find & replace (probably replace _all_)
d) place a warning or a suggestion when encountering '<<=', saying in 99% '<<' should be preferred (maybe pointing to an html page explaining way). This should be only a transitional message. Would it be possible to easily turn off the message for upp source?
e) Replace '<<=' in existing code with '<<' (more time consuming).
David
[Updated on: Thu, 06 December 2007 23:52] Report message to a moderator
|
|
|
 |
|
<<= 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: Fri Jul 18 00:08:33 CEST 2025
Total time taken to generate the page: 0.04136 seconds
|