Re: Type-safe iteration over the DOM in DOM 2 & 3?

On Thu, 22 March 2001, "Joseph Kesselman" wrote:

> Given our inabilty to rely upon methods being overloaded by argument
> signature,  we couldn't define the Visitor API as having both the methods
>      execute(Element e)
> and
>      execute(Attr t)

Couldn't it be done with something like:

function execute(void tmp) [
 switch(typeof(tmp)) {
  case "Attr":
  'Execute Attr code
  break;
  case "Element":
  'Execute Element vode:
  break;
 }
}
?

it simply see what kind of parameter it got and act accordinaly


Find the best deals on the web at AltaVista Shopping!
http://www.shopping.altavista.com

Received on Monday, 26 March 2001 09:07:50 UTC