Counting in Erlang (how do I increment a variable?)

后端 未结 4 596
孤独总比滥情好
孤独总比滥情好 2021-01-05 09:46

I\'ve figured out the Erlang-style loops: tail-recursion with functions that take all the \"variables that don\'t vary\":

%% does something, 80 bytes at a ti         


        
4条回答
  •  我在风中等你
    2021-01-05 10:10

    It all depends on what you are using the counter for. Anything global like the number of messages handled by q system should use ets:update_counter. If it is not global I usually just include it in the parameters like you showed.

提交回复
热议问题