<div dir="ltr">Thank you. That's good enough.<br><br><div class="gmail_quote">On Mon, Aug 18, 2008 at 1:18 PM, Richard Carlsson <span dir="ltr"><<a href="mailto:richardc@it.uu.se">richardc@it.uu.se</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">Matt Williamson wrote:<br>
> Hello,<br>
><br>
> In the docs for gen_server, there for example is call/2,3, two<br>
> signatures for the same base function. How do I use edoc to do something<br>
> similar? Basically I want one argument to be optional without writing a<br>
> @spec for each one. Here's what I have now:<br>
><br>
> %%===================================================================<br>
> %% API<br>
> %%===================================================================<br>
> %%-------------------------------------------------------------------<br>
> %% @spec put(Node, Key, Value) -> Result<br>
> %%     Result = {ok, inserted, Key} | {error, notinserted}<br>
> %%     Key = term()<br>
> %%     Value = term()<br>
> %%     Node = node()<br>
> %% @doc Inserts a Key, Value pair into the server.<br>
> %%-------------------------------------------------------------------<br>
> put(Key, Value) -><br>
>     put(node(), Key, Value).<br>
><br>
> put(Node, Key, Value) -><br>
>     gen_server:call({simpledb_svr, Node}, {insert, Key, Value}).<br>
<br>
</div></div>You currently need to provide a spec for both, but for put/2, you<br>
can write "@equiv put(node(), Key, Value)" instead of the @doc.<br>
<font color="#888888"><br>
    /Richard<br>
</font></blockquote></div><br></div>