Otter Snippets Otter Upstream Otter 1.0.1 Tested

Filter List by Condition

Filter elements from a list into a new target list using a condition.

ID: snippet/list-filter-items Version: 1.0.0 License: MIT Framework: Otter 1.0.1

Architecture & Runtime Preview

Otter 1.0.1

Zero-dependency Otter 1.0.1 snippet (Collections & Lists). Copy the parameterized template or run the self-contained example.

  1. 1Category: Collections & Lists
  2. 2Attribution: Otter Reusable Library (Official)
  3. 3Zero external pack dependencies — paste directly into any .ot file

Source Code (2 files)

template.ot · otter
filtered are empty
for each ${item} in ${items}
    if ${condition}
        add ${item} to filtered
    .
.

Installation & Usage

otter snippet inspect list-filter-items

Copy template.ot directly into your .ot source file, or run example.ot with 'otter run example.ot'.