docs/language: a page for every keyword and attribute the vocabulary has
Keywords: module uses friend export internal numbers unsafe mut port bind action reducer registry of as from def open alias component prop view (structure), shows lasts then loads (scenes), system (ecs), dispatch (control), true false null (operators). Attributes: @Ref @OneOf @Range @Unit @Asset @Color, @Node / @Clip / @Material, @Tint @Derived, @Text / @Multiline, @Key, @AppendOnly / @ByKey, @PerMap / @Chunked, @frame @max, @owns / @creates / @releases, @deterministic @alloc_ok. Each is in tools/docgen/inventory.json; every fence that is not marked skip parses (ludicc --fmt). annot-clearcolor's token loses its quotes, which no reader strips. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
eb2d6106af
commit
e2528c1b10
49 changed files with 746 additions and 7 deletions
19
docs/language/structure/kw-port.md
Normal file
19
docs/language/structure/kw-port.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
id: kw-port
|
||||
name: port
|
||||
category: structure
|
||||
kind: keyword
|
||||
tokens: port
|
||||
sig: port Name { member: fn(T) -> R [= default], ... }
|
||||
tip: The questions a module asks the world, bound once by the program.
|
||||
order: 59
|
||||
---
|
||||
|
||||
A <code>port</code> is what a module needs to ask the world, as named function members in primitive types. The program answers it once with <code>bind</code>; a member left unbound without a default is a compile error. Ports let a package ask a question without reaching into the module that knows the answer.
|
||||
|
||||
```ludic
|
||||
# doc-check: skip — a module spans files
|
||||
export port ClockWorld {
|
||||
rest_scale: fn() -> float
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue