Kinda like with GCC, allow detection of constant values (i.e.
__builtin_constant_p<http://developer.apple.com/documentation/developertools/gcc-4.0.1/gcc/Other-Builtins.html>).
This way, you could do something like

void addParameter (HashMap h, int size, String key, Object value)
{
   if (GWT.isConstantValue(h, null)) {
      if (GWT.isConstantValue(size, 0))
         size = 10;
      h = new HashMap(size);
   }
   h.put(key, value).
}

& you could have the performance of

void addParameter (HashMap h?, int size?, String key, Object value)

as if you wrote overloaded methods without needing to write several
different methods that just supply default values back & forth.  Sometimes,
it's also possible to use a better algorithm if parameters have a known
constant value.

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to