Skip to content
Internals
Draft. This essay is a stub or a work in progress — read it as a sketch, not settled documentation.

Name Resolution & Scoping

Marks can be given names with .name(...) and referenced elsewhere — across charts — via select(...). GoFish resolves those names with hygienic, bounded scoping rather than letting every descendant name bubble up globally. This essay will explain the resolution algorithm and the design rationale.

Planned contents

  • How .name() registers a node and how select() resolves it.
  • Hygienic scoping: why names are bounded to a scope instead of bubbling to all descendants, and what bug class that prevents.
  • Interaction with the context system and with the layout passes.
  • Cross-chart references and ref marks.

Source

Likely covers:: the name/scope resolution code under packages/gofish-graphics/src/ast/. Add the covers: frontmatter when writing this up, then run pnpm --filter docs sync-backlinks.