Skip to content

Instantly share code, notes, and snippets.

@copenhas
Created March 31, 2011 14:49
Show Gist options
  • Select an option

  • Save copenhas/896492 to your computer and use it in GitHub Desktop.

Select an option

Save copenhas/896492 to your computer and use it in GitHub Desktop.
set_options(Bt, []) ->
Bt;
set_options(Bt, [{split, Extract}|Rest]) ->
set_options(Bt#btree{extract_kv=Extract}, Rest);
set_options(Bt, [{join, Assemble}|Rest]) ->
set_options(Bt#btree{assemble_kv=Assemble}, Rest);
set_options(Bt, [{less, Less}|Rest]) ->
set_options(Bt#btree{less=Less}, Rest);
set_options(Bt, [{reduce, Reduce}|Rest]) when is_function(Reduce, 2) ->
set_options(Bt#btree{reduce=Reduce}, Rest).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment