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

后端 未结 4 561
孤独总比滥情好
孤独总比滥情好 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:04

    Don't use the process dictionary.

    The 'normal' loop that you are expecting (ie a for loop or a do while) is usually implemented in a recursive function in Erlang so if you are incrementing a 'normal' counter do it in the function calls like you show up top.

    Don't use the process dictionary.

    In case you missed, can I just point out that you should not use the process dictionary.

提交回复
热议问题