F#: let mutable vs. ref

后端 未结 5 653
悲&欢浪女
悲&欢浪女 2020-11-29 20:17

First, I acknowledge the possibility that this question could be a duplicate; just let me know.

I\'m curious what the general \"best practice\" is for those situatio

5条回答
  •  佛祖请我去吃肉
    2020-11-29 20:44

    This article by Brian might provide an answer.

    Mutables are easy to use and efficient (no wrapping), but can't be captured in lambdas. Ref cells can be captured, but are verbose and less efficient (? - not sure of this).

提交回复
热议问题