patternsiterator | Skill Performance & Reviews | TopRankSkills

TopRank Skills

Home / Skills / tools / patternsiterator

patternsiterator

maintained by mgreenly

star 1 account_tree 0 verified_user MIT License
bolt View GitHub

name: patterns/iterator description: Iterator Pattern pattern for C development

Iterator Pattern

Provide sequential access to collection elements without exposing underlying structure. In C, typically a struct with next() function or index-based traversal.

ikigai Application

Scrollback traversal: Iterate visible lines for rendering without exposing ring buffer internals.

Message iteration: Walk session messages for LLM context building.

Implementation options:

// Index-based (simple)
for (size_t i = 0; i < scrollback->count; i++) { ... }

// Iterator struct (encapsulated)
ik_iter_t *iter = ik_scrollback_iter(scrollback);
while (ik_iter_next(iter, &line)) { ... }

Current approach: Index-based iteration is sufficient. Iterator struct adds value when traversal logic is complex or needs to hide internals.

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!

Skill Details

GitHub Stars 1
GitHub Forks 0
Created Jan 2026
Last Updated 5 months ago
tools tools ide plugins

Related Skills

writing-skills
chevron_right
codex
chevron_right
smart-illustrator
chevron_right
ast-index
chevron_right
packmind-standard-creator
chevron_right

Build your own?

Join 12,000+ developers contributing to the Claude ecosystem.