大修 Nix 语言快速入门(第二部分) #48
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
此为应 @ryan4yin 邀请大幅修改 Nix 语言快速入门工程的第二部分,范围是
递归属性集一节。本次重写发现原教程存在很有迷惑性的事实错误,在原教程中给了一个例子
其结果为
原教程借此说明
我之前看这段的时候极其迷惑,怎么也无法理解 three 为什么会比 two 更先求值。直到我把两处
one一起换成zne:看到下面的结果
而茅塞顿开的时候,真的想问问原教程的作者是出于什么心理,脑补出了“优先被求值的被放在了前面”这种跟自己的例子都对不上的奇怪结论。所幸本 PR 合并之后,读者就能免于像我一样被怎么也想不通的这个地方折磨了。