basho / basho_docs

Basho Products Documentation
http://docs.basho.com
Other
169 stars 191 forks source link

Example will not compile #2523

Open aleklisi opened 5 years ago

aleklisi commented 5 years ago

https://docs.riak.com/riak/kv/2.0.4/developing/app-guide/advanced-mapreduce/#reduce-function-examples This

fun(ValueList, _Arg) ->
  [lists:foldl(fun erlang:'+'/2, 0, List)]
end.

will not compile, because List is unbound. Unless List is defined somewhere prior, but since it is not written, I assume it is not.
It should look like this:

fun(ValueList, _Arg) ->
  [lists:foldl(fun erlang:'+'/2, 0, ValueList)]
end.