RIDDL 2.8.3 Released
RIDDL 2.8.3 is now available.
release riddl compiler
RIDDL 2.8.3 is now available. This release of the RIDDL compiler and language tooling includes the following changes:
What’s New
What’s New
Features
- Collection map:
each of <coll> as <e> [where <p>] yielding <value>— The language can now reshape a collection, not just filter it. Each element that passes the optionalwherefilter is bound to<e>, and the projection is computed for it. The projection may be any value expression: a field, an arithmetic expression, a record constructor and so on. This replaces thepromptthat was the only way to write, for example, an entity built from the filtered and reshaped lines of a message.- Typing: the result is a collection of the projection’s type. Without a
filter it keeps the source’s cardinality:
T+givesU+, and anything else givesU*. A filter lowers the minimum to zero, so a filtered map that fills aT+draws the existing optional-for-required Advisory. - Checks: the element is in scope only in the filter and the projection. The source must be a collection and the filter must be boolean.
- Reserved words: neither
eachnoryieldingis reserved. - Computational Model: B5 now records what a generator must preserve: the source order, one result per admitted element, the filter applied before the projection, and per-element effects in order.
- Typing: the result is a collection of the projection’s type. Without a
filter it keeps the source’s cardinality:
msg-answer-unreachable(Completeness) — reported for asendortellof a command thatyields, or a query thatreplies, when no route carries the answer back to an inlet of the sender that admits it. The route check is type-aware: a path that exists but cannot carry the answer type does not count.stmt-send-duplicates-yield(Style) — reported for asendthat publishes the same value on an outlet the siblingyieldorreplyalready publishes on, which puts a second copy on that outlet. This follows CM §20.4, which now states that a yield or reply is published on every outlet of its processor that admits its type.
Bug Fixes
- Prettify of keyword-led operands — prettify wrote
any of (query T) as r where pasany of query T as r where p, which does not parse.query,prompt,call,ask,createand constructors used as the operand of an operator now always keep their parentheses. No canonical form changes, since none of these operands could parse without parentheses before.
Internal
- BAST
FORMAT_REVISIONis now 38, for the collection map (value tag 30). Readers reject.bastfiles written at an older revision, so regenerate them with this riddlc. - JSON: the collection map is written as
"value": "map", withcollection,element, an optionalfilter, andprojection. - The EBNF grammar, Finder, find kinds (
collection-map) andJSON_COVERAGE.mdare updated to match. - Known gap: a
T{n,m}range type has no source spelling, because no parser rule builds one, so it is reachable only from BAST or JSON. Whether to add syntax for it or correct the documentation is still open.