[erlang-patches] [PATCH] Fix lists:foreach/2's documented spec

Björn Gustavsson bgustavsson@REDACTED
Mon Oct 11 14:04:23 CEST 2010


On Sun, Oct 10, 2010 at 7:02 PM, Tuncer Ayaz <tuncer.ayaz@REDACTED> wrote:
> ---
>  lib/stdlib/doc/src/lists.xml |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/stdlib/doc/src/lists.xml b/lib/stdlib/doc/src/lists.xml
> index 92c4eb4..0cf88fe 100644
> --- a/lib/stdlib/doc/src/lists.xml
> +++ b/lib/stdlib/doc/src/lists.xml
> @@ -297,10 +297,10 @@ flatmap(Fun, List1) ->
>       </desc>
>     </func>
>     <func>
> -      <name>foreach(Fun, List) -> void()</name>
> +      <name>foreach(Fun, List) -> ok</name>
>       <fsummary>Apply a function to each element of a list</fsummary>
>       <type>
> -        <v>Fun = fun(Elem) -> void()</v>
> +        <v>Fun = fun(Elem) -> term()</v>
>         <v> Elem = term()</v>
>         <v>List = [term()]</v>
>       </type>
>

void() is a convention used in the documentation to mean
that the function has no useful return value and should be
ignored. It is used in many places in the documentation.
Try:

git grep 'void()' | grep '[.]xml'

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB


More information about the erlang-patches mailing list