objectscript-list-patterns

Build, iterate, and convert ObjectScript lists with $LISTBUILD and $LISTNEXT.

27|10|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/intersystems-community/iris-dev --skill objectscript-list-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: objectscript-list-patterns
Source: https://github.com/intersystems-community/iris-dev/tree/main/light-skills/skills/objectscript-list-patterns
Command: npx skills add https://github.com/intersystems-community/iris-dev --skill objectscript-list-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

ObjectScript list manipulation is verbose and error-prone. This Skill provides ready-made patterns to build, iterate, deduplicate, convert, and manage lists efficiently.

Core Features & Use Cases

  • Build and accumulate lists using %ListOfDataTypes and $LISTBUILD, with final conversion to strings via $LISTTOSTRING.
  • Iterate safely over lists using $LISTNEXT and the 1-based %List API, enabling robust processing even for empty lists.
  • Deduplicate values using a local hash-like array pattern to achieve linear-time performance.
  • Convert between raw lists and object wrappers and demonstrate common workflows such as CSV creation and element extraction.
  • Use case: normalize a dataset by merging two lists with unique items and exporting to a delimited string for reporting.

Quick Start

Instruct the AI to build a sample list, deduplicate it, and output a comma-delimited string using the provided patterns.

Frequently Asked Questions about objectscript-list-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I iterate over an ObjectScript list safely without errors on empty inputs?

You can convert an ObjectScript list to a delimited string using the $LISTTOSTRING function. This allows you to easily generate CSV outputs or export list data for reporting purposes.

What is the best way to deduplicate values in an ObjectScript list efficiently?

The best way to deduplicate ObjectScript list values is by using a local hash-like array pattern. This approach achieves linear-time performance, making it highly efficient for unique item extraction.

How do I convert between raw %List and %ListOfDataTypes in ObjectScript?

You can convert between raw %List and %ListOfDataTypes in ObjectScript using $LISTBUILD to create lists and object wrappers for management. This facilitates common workflows like element extraction and list accumulation.

Can I merge two ObjectScript lists and export the unique items to a delimited string?

Yes, you can merge two ObjectScript lists by accumulating items with %ListOfDataTypes, applying a local array pattern for deduplication, and converting the final result to a delimited string via $LISTTOSTRING.

Why does my ObjectScript list manipulation fail when building lists across classes and routines?

ObjectScript list manipulation fails across classes and routines because the process is verbose and error-prone without consistent patterns. Applying standard $LISTBUILD and $LISTNEXT guidelines ensures safe list accumulation and removal.