Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % -*- coding: utf8 -*-
- -module(main).
- -export([main/0]).
- main() ->
- Block =
- fun() ->
- U = erlang:unique_integer([positive, monotonic]),
- io:format("~p~n", [U]),
- U
- end,
- Pred =
- fun(U) ->
- U < 3
- end,
- do_while(Block, Pred).
- do_while(Block, Predicate) ->
- case Predicate(Block()) of
- true -> do_while(Block, Predicate);
- false -> ok
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement