[erlang-questions] spec declaration for single list parameter with fixed size
Sun Jul 3 10:10:16 CEST 2011
a very stupid spec declaration question. how can you declare the specs of a
function which has a single list with multiple arguments?
For instance, consider this function:
myfun([One, Two]) ->
these two following declarations do obviously not work:
-spec myfun([One::string(), Two::integer()]) ->
-spec myfun(list(One::string(), Two::integer())) ->
the proper way seems to be:
-spec myfun([string() | integer()]) ->
however i feel this to be very misleading, as the specs do not show the
order nor the fixed length of the parameter list.
is there a better way to do so?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions