Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.36 KB | None | 0 0
  1. -module(test).
  2. -compile(export_all).
  3.  
  4. do_until(TestFun, DoFun, Acc) ->
  5.     case TestFun(Acc) of
  6.         true ->
  7.             DoFun(),
  8.             do_until(TestFun, DoFun, Acc - 1);
  9.         false -> ok
  10.     end.
  11.  
  12.  
  13. go() ->
  14.     IfTest = fun(N) ->
  15.        N > 0
  16.     end,
  17.     DoIt = fun() ->
  18.         io:format("fuck",[])
  19.     end,
  20.     do_until(IfTest, DoIt, 10).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement