Re: [WebIDL] Default Values for Arguments

On Fri, 13 Nov 2009, Steffen Krüssel wrote:
> 2009/11/13 Simon Pieters <simonp@opera.com>
> >
> > I think you want something like:
> >
> >   interface textbox {
> >     void setText(in DOMString text, in optional unsigned long long color);
> >   }
> >
> >   When the color argument is omitted, the default value of black/0 must
> >   be used.
> 
> I don't think that the "optional" attribute is sufficient as this does not
> (formally) specifies what is being implicitly done in that case (i.e. using
> a default value).

It's not just "optional", it's also the text after the interface, saying 
what the requirements on the implementations are.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 24 November 2009 11:53:44 UTC