Interactions between optional and nullable

Hi,

I've been trying to figure out what the expected approach should be for the following case:

  interface Dahut {
      void foo (optional Foo foo, optional Bar bar);
  };

Assuming I want to call myDahut.foo() but skip the first parameter, the idiomatic ES would typically be:

  myDahut.foo(null, myBar);

But it turns out that the first parameter isn't defined as nullable. What happens here?

 1) Is the implementation supposed to figure out that I didn't want to provide the first parameter? Maybe convert it to undefined?
 2) Are people expected to call myDahut.foo(undefined, myBar) instead?
 3) Should the operation be better defined with Foo being nullable?

Thanks!

--
Robin Berjon
  robineko — hired gun, higher standards
  http://robineko.com/

Received on Tuesday, 8 December 2009 15:47:17 UTC