Guest User

Untitled

a guest
Oct 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. -module(complex).
  2. -compile(export_all).
  3.  
  4. header() ->
  5. "Colors".
  6.  
  7. item() ->
  8. A = dict:from_list([{name, "red"}, {current, true}, {url, "#Red"}]),
  9. B = dict:from_list([{name, "green"}, {current, false}, {url, "#Green"}]),
  10. C = dict:from_list([{name, "blue"}, {current, false}, {url, "#Blue"}]),
  11. [A, B, C].
  12.  
  13. link(Ctx) ->
  14. {ok, Val} = dict:find(current, Ctx), Val.
  15.  
  16. list() ->
  17. length(item()) =/= 0.
  18.  
  19. empty() ->
  20. length(item()) =:= 0.
  21.  
  22.  
  23. %%---------------------------------------------------------------------------
  24.  
  25. start() ->
  26. code:add_patha(".."),
  27. Output = mustache:render(complex, "complex.mustache"),
  28. io:format(Output, []).
Add Comment
Please, Sign In to add comment