A local of a package's type is named by its qualified type in the break buffer's listing and the inspector, pinned by a shape/Box local in dev-inspect.flan

This commit is contained in:
Joseph Ferano 2026-09-25 15:16:56 +07:00
parent 5b8c4a68fa
commit 58d1e35225
3 changed files with 20 additions and 8 deletions

View File

@ -1693,12 +1693,6 @@ a defcustom.
The agent keeps the condition pointer beside its name and a verb hands it back, so The agent keeps the condition pointer beside its name and a verb hands it back, so
the editor can render the condition's own fields rather than only its class. the editor can render the condition's own fields rather than only its class.
** NEXT The type identity of a local is not qualified
Decided 2026-09-25: a local's type prints package-qualified in the break buffer and the inspector, as a field's and a condition's already do.
Settled for conditions and for structs, because =Load= qualifies every declaration
at import. Still open for locals, where the debug information gives a bare name and
nothing qualifies it.
** NEXT The render-thunk-per-inspection design ** NEXT The render-thunk-per-inspection design
Decided 2026-09-25: the inspector reads a value through the type layouts the compiler records, with no compile per inspection, which lets it hold a value. Decided 2026-09-25: the inspector reads a value through the type layouts the compiler records, with no compile per inspection, which lets it hold a value.
An inspection still compiles a thunk per request. A redesign rather than a An inspection still compiles a thunk per request. A redesign rather than a

View File

@ -11,8 +11,10 @@
;;;; The other locals are the shapes a path step has to walk and that an ;;;; The other locals are the shapes a path step has to walk and that an
;;;; expression cannot reach at all: an option's payload, which has no ;;;; expression cannot reach at all: an option's payload, which has no
;;;; accessor form in the language, and a union case's field, whose offset ;;;; accessor form in the language, and a union case's field, whose offset
;;;; depends on which case the value is in. ;;;; depends on which case the value is in. And a local of a package's type,
;;;; which is named as the checker names it everywhere else: qualified.
(import agent "vendor:agent") (import agent "vendor:agent")
(import shape "pkgs/shape")
(defstruct Point [x f32 y f32]) (defstruct Point [x f32 y f32])
(defstruct Boom [why i32]) (defstruct Boom [why i32])
@ -38,7 +40,8 @@
(let [mark (Point {.x 1.5 .y 2.5}) (let [mark (Point {.x 1.5 .y 2.5})
xs [10 20 30] xs [10 20 30]
box (Some (Point {.x 4.5 .y 5.5})) box (Some (Point {.x 4.5 .y 5.5}))
s (Shape.Rect {.w 3 .h 6})] s (Shape.Rect {.w 3 .h 6})
pk (shape/box 3 4)]
(deeper))) (deeper)))
(defonce ticks i64) (defonce ticks i64)

View File

@ -2516,6 +2516,21 @@ let () =
want "box" "(some)" "Point" "(Point {.x 4.5 .y 5.5})"; want "box" "(some)" "Point" "(Point {.x 4.5 .y 5.5})";
want "box" "(some \"x\")" "f32" "4.5"; want "box" "(some \"x\")" "f32" "4.5";
want "s" "(\"Shape.Rect.w\")" "i32" "3"; want "s" "(\"Shape.Rect.w\")" "i32" "3";
(* A package's type is its qualified name, in the inspector and in
the listing both, as a field's and a condition's already are:
two packages may each declare a Box. *)
want "pk" "()" "shape/Box" "(shape/Box {.w 3 .h 4})";
(match Wire.field listing "locals" with
| Some { Form.v = Form.List l; _ }
when List.exists
(fun (e : Form.t) ->
match e.Form.v with
| Form.List
({ Form.v = Form.Str "pk"; _ }
:: { Form.v = Form.Str "shape/Box"; _ } :: _) -> true
| _ -> false)
l -> ()
| _ -> fail "the listing does not name pk's type as shape/Box");
(* Where each value is stored. The struct and its first field share (* Where each value is stored. The struct and its first field share
an address and the second field is one f32 further on, so the an address and the second field is one f32 further on, so the
number is the layout's and not a label. *) number is the layout's and not a label. *)