示例工程 07-functions-and-tail-calls
07-functions-and-tail-calls/04-named-params/README.md
# 04 · named-params
**演示**:传表 + `options.x or default` 模拟命名参数。
**运行时**:`lua54`、`luajit`。
**运行**:
```sh
.tools/bin/lua54 scripts/run-example.lua examples/07-functions-and-tail-calls/04-named-params
.tools/bin/lua54 scripts/test-example.lua examples/07-functions-and-tail-calls/04-named-params
```
**预期输出**(lua 5.4.9 / macOS arm64):
```text
address=db:5432
empty=localhost:8080
```
**看点**:命名参数在 Lua 只是约定,没有编译期检查。
**注意**:`false` 作为合法值时要显式判断 `~= nil`。