Files
marqdo/tests/notebook/shared.mq.md
T
cflmyandCursor 687c168014 feat(parse): use nested YAML import: maps instead of one-liner binds
Frontmatter imports are now valid YAML (`import:` / `导入:` with bind→target
entries), removing spaced keys. Add `marqdo migrate imports`, hard-error the
old one-liner form, and migrate lib/ext/examples/tests/docs accordingly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-23 19:33:58 +08:00

40 lines
687 B
Markdown

---
title: notebook shared state
import:
foreign: lib/foreign.mq.md
---
# main
`内核表` =
| 名称 | 语言 | 命令 | 说明 |
|------|------|------|------|
| 分析 | node | | 共享状态的内核 |
| 绘图 | node | | 隔离的内核 |
`会话表` =
| 单元 | 内核 | 说明 |
|------|------|------|
| 设置 | 分析 | 写入共享变量 |
| 读取 | 分析 | 读取共享变量 |
| 隔离 | 绘图 | 看不到 shared |
`会话` = > foreign.session kernels=`内核表` cells=`会话表`
`设置` =
```node
let shared = 41;
```
`读取` =
```node
console.log(shared + 1);
```
`隔离` =
```node
console.log(typeof shared === "undefined" ? "isolated" : "leaked");
```