Advantages of define over let

让人想犯罪 __ 提交于 2019-12-10 13:15:13

问题


During a conversation with Matt Flatt, one of the primary authors of Racket, I was told (in passing) that the let form is not recommended by the community and is largely being replaced by define.

What are the advantages of define over let that would prompt the Racket community to elect to use it in place of let?

For reference, define and let from the Racket documentation are linked here.


回答1:


"To reduce rightward drift"

See the section 4.2 on definitions: http://www.ccs.neu.edu/home/matthias/Style/style/Choosing_the_Right_Construct.html

That said, I see it mostly as a matter of taste.



来源:https://stackoverflow.com/questions/21651962/advantages-of-define-over-let

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!