a↗agentbay.Get AgentBay
My account ▾
Menu
Back to results

mps-collections-and-closures

Use when writing or editing MPS BaseLanguage code that uses the `collections` and `closures` language extensions — in behavior methods, typesystem and checking rules, generator queries, constraints, intentions, plugin or console code, with or without nodes. Covers collection types (`sequence<T>`, `list<T>`, `set<T>`, `map<K,V>`, sorted variants),…

Full publisher description

Use when writing or editing MPS BaseLanguage code that uses the `collections` and `closures` language extensions — in behavior methods, typesystem and checking rules, generator queries, constraints, intentions, plugin or console code, with or without nodes. Covers collection types (`sequence<T>`, `list<T>`, `set<T>`, `map<K,V>`, sorted variants), creators, sequence operations (`.where`, `.select`, `.translate`, `.any`, `.sortBy`, `.toList`, …), list/set/map mutators, the collections `foreach` vs the BaseLanguage `foreach`, closure literals (`{ it => ... }`, `ClosureLiteral`, `InferredClosureParameterDeclaration`, `FunctionType`), `yield`, `skip`, `stop`, recursion with `invoke`, SAM conversion, and `downcast` to a Java interface. The node receivers (`node.descendants<C>`, `nlist<C>`, `sequence<node<C>>`) come from the companion skill `mps-model-manipulation`; most smodel bodies need both.

Source details

Read SKILL.md ↗ · Browse skill folder ↗

JetBrains/MPS

.agents/skills/mps-collections-and-closures/SKILL.md

Pinned revision f3ba27fd89e78216914f80fac1812c8dc3da588d

Source checked

Reviewed licence: Apache-2.0
repository

Reviewed publisher revision ↗ · 2026-11-22
This indexed source has a different revision. Verify its applicable terms before use.

This skill page is available in English. Publisher instructions stay in their original language.