-
Notifications
You must be signed in to change notification settings - Fork 20
Update Manuals for Control Structures #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ryan4yin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感谢 PR,我补充了一些修改建议
inclyc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update Manuals for Control Structures
总体上 Nix 语言作为纯函数式编程语言并不存在“控制流”,即所有的语言结构都是 expression ,不存在 statement.
inclyc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
总体上我觉得没有必要在函数式编程语言中描写“如何用函数式模拟指令式”,这应该是 SICP 之类课程就已经学过的,只用介绍一下 if-then-else ,和介绍一些官方函数即可。
不是所有读者都系统性的学习过计算机专业的课程,更笼统的讲,读者可能不是工科专业。我觉得面向的读者的内容应该更加大众化。 |
是这样没错,既然这种介绍这么重要,我们为什么不把他放到一个专门的章节,反而要把他和别的“表达式”并列呢? |
因为这仅是些 Example?其实是可以独立开一个专门章节的啦,但应该是其他PR的事情。这次的PR只是补上原有拟定的条件判断与循环控制空缺。 |
Co-authored-by: Yingchi Long <i@lyc.dev>
ryan4yin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我重写了部分内容,看看各位意见。
对循环控制这一部分的内容:补足了函数相关的参考链接,以及函数搜索渠道。采纳~ |
Co-authored-by: Ryan Yin <xiaoyin_c@qq.com>
src/tutorials/lang/Manuals.md
Outdated
|
|
||
| 这里举个简单的例子来说明 Nix 语言中如何实现一个递归函数: | ||
|
|
||
| > ⚠️注意:`nixpkgs.lib` 提供的函数对新手基本够用了,需要自行实现递归函数的场景并不多,在决定自行实现前,建议先检索下官方函数库。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个我不小心补了两遍,可以删掉。
另外前面部分内容格式化有点问题。
其他的我觉得没毛病了,等格式化的 PR 搞定后可以 merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
格式化问题交给prettier做吧,总归要自动格式化的。
Co-authored-by: Yingchi Long <i@lyc.dev>
Co-authored-by: Yingchi Long <i@lyc.dev>
inclyc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Please wait for @ryan4yin's comments :)
Added condition expression and loop part