Skip to content

Object inspection API - #39

Merged
adh merged 1 commit into
mainfrom
generalized-inspector
Sep 5, 2026
Merged

adh merged 1 commit into
mainfrom
generalized-inspector

Conversation

@adh

@adh adh commented Sep 5, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings September 5, 2026 20:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The inspection name currently formats pointer identity using the raw tagged LT_Value, producing incorrect 0x... identities for tagged pointer types (e.g., Pair/List).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR introduces a presentation-independent “object inspection” API (Object>>inspection) backed by a new ObjectInspection class, and updates the interactive debugger inspector to consume that API. It also exposes an inspect primitive in the interactive REPL and adds tests to validate inspection behavior for core types.

Changes:

  • Add ObjectInspection native class plus C API helpers and accessors.
  • Implement Object>>inspection and specialized inspections for List, Environment, and Class; update debugger inspector to render slots/contents from inspections.
  • Bind ListTalk:inspect in the CLI base environment and add CLI + C API tests for the new behavior.
File summaries
File Description
tests/listtalk_cli_test.py Adds a REPL-level test ensuring inspect is bound as a primitive.
tests/c_api_test.c Adds C API tests for Object>>inspection and specialized contents for lists/environments/classes.
src/debugger/debugger.c Switches inspector UI to use Object>>inspection and renames the primitive to ListTalk:inspect.
src/classes/ObjectInspection.c Implements the new ObjectInspection native class, accessors, and constructor.
src/classes/Object.c Adds Object>>inspection and the core inspection construction helpers.
src/classes/List.c Adds List>>inspection to expose elements as inspection contents.
src/classes/Environment.c Adds Environment>>inspection to expose bindings as inspection contents.
src/classes/Class.c Adds Class>>inspection to expose direct methods as inspection contents.
src/bin/listtalk/main.c Binds inspect into the CLI base environment.
meson.build Registers ObjectInspection.c in the build.
ListTalk/ListTalk.h Exposes ObjectInspection in the umbrella header.
ListTalk/debugger/debugger.h Declares LT_Debugger_define_inspect.
ListTalk/classes/ObjectInspection.h Public header for ObjectInspection.
ListTalk/classes/Object.h Public header additions for the inspection APIs.
Review details
  • Files reviewed: 13/14 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/classes/Object.c
Comment on lines +236 to +240
name_text = LT_sprintf(
"%s at 0x%" PRIxPTR,
LT_Symbol_name(LT_Symbol_from_value(klass->name)),
(uintptr_t)object
);
@adh
adh merged commit d9d34e3 into main Sep 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants