[Little Change]: 重写了模块系统关于省略 config key 的说明 (#159)

* [Little Change]:重写关于省略 `config` 的声明

* [Little Change]:rewrite about "emit declaration of `config`"
This commit is contained in:
jinzhongjia 2024-05-13 00:05:39 +08:00 committed by GitHub
parent b38976ad9d
commit 3b322cd852
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 6 deletions

View File

@ -202,9 +202,9 @@ for `foo` by setting the `options` defined here. For example:
```
In the example above, the way we assign values to `options` is actually a kind of
**abbreviation**. When a module declares only `options` without `config` (and other
special parameters of the module system), we can omit the `config` prefix and directly use
the name of `options` for assignment.
**abbreviation**. When a module only contains `config` without any other delcaration (like `option` and other
special parameters of the module system), we can omit the `config` wrapping , just directly write the
content of `config` to assign value to `option` section declared in other modules!
## Assignment and Lazy Evaluation in the Module System

View File

@ -183,9 +183,8 @@ foo 的自定义配置了,示例:
}
```
上面这个例子中我们为 `options` 赋值的方式实际上是一种**缩写**,当一个模块中只声明了
`options`,而没有声明 `config` (以及其他模块系统的特殊参数)时,我们可以省略掉 `config`
前缀,直接使用 `options` 的名称进行赋值。
上面这个例子中我们为 `options` 赋值的方式实际上是一种**缩写**,当一个模块中只包含定义(`config`),而没有声明(`option`,并且没有其他特殊参数)时,我们可以省略掉 `config`
包装,直接书写 `config` 部分来对其他模块中已声明的 `option` 赋值。
## 模块系统的赋值与延迟求值 {#module-system-assignment-and-lazy-evaluation}