What are futures?

后端 未结 7 1711
梦毁少年i
梦毁少年i 2021-02-13 09:29

What are futures? It\'s something to do with lazy evaluation.

相关标签:
7条回答
  • 2021-02-13 10:27

    A Future encapsulates a deferred calculation, and is commonly used to shoehorn lazy evaluation into a non-lazy language. The first time a future is evaluated, the code required to evaluate it is run, and the future is replaced with the result.

    Since the future is replaced, subsequent evaluations do not execute the code again, and simply yield the result.

    0 讨论(0)
提交回复
热议问题