Skip to content

Collections omissions - #32

Merged
adh merged 2 commits into
mainfrom
collections-omissions
Aug 14, 2026
Merged

adh merged 2 commits into
mainfrom
collections-omissions

Conversation

@adh

@adh adh commented Aug 14, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings August 14, 2026 16:04

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.

Pull request overview

This PR fills in missing collection APIs in ListTalk by adding filter, asVector, size/empty?, and a set of iterator combinators (including a new lazy FilterIterator) along with corresponding tests to prevent regressions.

Changes:

  • Added List>>filter: and LT_List_filter, plus List>>asVector conversion.
  • Added Set>>size and Set>>empty?.
  • Extended Iterator with asIterator, map:, filter:, forEach:/do:, any:, every:, inject:into:, reduce:, and introduced FilterIterator with VM binding.
  • Added/expanded tests for the above behaviors (including laziness/consumption semantics).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/eval-objects.lt Adds a regression test for Vector>>asVector returning the receiver.
tests/eval-collections.lt Adds coverage for list filtering, list-to-vector conversion, set size/emptiness, and iterator combinators (including lazy map/filter and consuming operations).
src/vm/base_env/base_env.c Registers FilterIterator in the native class bindings so it’s available in the base environment.
src/classes/Vector.c Implements Vector>>asVector as an identity conversion and registers the method.
src/classes/Set.c Implements and registers Set>>size and Set>>empty?.
src/classes/List.c Adds LT_List_filter, List>>filter:, and List>>asVector (with vector allocation/fill).
src/classes/Iterator.c Adds iterator combinators on Iterator and introduces the FilterIterator class implementation.
ListTalk/classes/List.h Exposes LT_List_filter in the public list API.
ListTalk/classes/Iterator.h Declares the new LT_FilterIterator class and constructor.

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

@adh
adh merged commit af4c479 into main Aug 14, 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