Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » <<= and <<
Re: <<= and << [message #13046 is a reply to message #12958] Thu, 06 December 2007 23:44 Go to previous messageGo to previous message
waxblood is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Bug in Core06.cpp or in U++ Core value types tutorial
Next Topic: operator< for container sorting (small confusion)
Goto Forum:
  


Current Time: Fri Jul 18 00:08:33 CEST 2025

Total time taken to generate the page: 0.04136 seconds