S++Core systems, human-reviewable
S++ (SERVPP) · Language guide

What's New in S++: Pick, Explicit Bounds and Scope Rules

This note follows the previous summary and covers the changes that reached the public basic SDK on 29 November 2026. It describes the SDK at the time of writing; the tutorial and SDK user guide remain the reference for exact behaviour.

pick: choose one element by key

A transfer over collections used to select its two positions with nested loops and an if. If no position matched, the line did nothing; if two matched, it transferred twice. pick states the selection directly and checks that exactly one element was found:

quantum update moveSlip(Slip, Giving[], Receiving[]) {
    for (SlipLine line : slip.lines) {
        Giving source = pick givings by owner = slip.giver and kind = line.kind;
        Receiving target = pick receivings by owner = slip.taker and kind = line.kind;
        source.pieces -> target.pieces : line.units;
    }
}

The picked local is the element itself, not a copy, and it can be a transfer endpoint. In a quantum update a missing match is QUANTUM_MATCH_MISSING and an ambiguous one is QUANTUM_MATCH_AMBIGUOUS; both roll back the whole slip. The key must name every field that identifies one position, or the compiler reports PICK_KEY_INCOMPLETE. A field that the find hydrating the collection already fixes, such as the owner when the scenario finds one owner's positions by a scalar key, may be left out of the key.

pick first and pick last say which of several matches to take. The same expression also reads one element in a calculate or check, replacing a loop that searches a collection; there the run-time codes are PICK_MATCH_MISSING and PICK_MATCH_AMBIGUOUS. spp-basic explain describes each code.

Every debited position needs an explicit bound

A call to a quantum update must now state a bound for each position it can debit, named by the scenario argument. This includes the elements of a loop over a collection parameter. An unlimited debit is written [null, null]:

transaction {
    transferWalletFunds bounds {
        settlementAccount.balance: [null, null];
        buyer.wallet: [0, null];
    };
}

A missing entry is the compile error SPP_QUANTUM_BOUND_REQUIRED. The limit is a fact of the business transaction, usually read from the customer contract, so it is not declared on the account; the scenario states it at the call. Credit-only positions need no entry. When a scenario calls an atomic update that is bound to a provider's quantum update, the call bounds may name the caller's own field, and the check is made against the provider's conserved attribute. The Petstore and the SDK samples were updated accordingly.

Failing checks and scopes

  • A failing check ends its enclosing serial, parallel or transaction block, or the scenario body, at any depth of if/else nesting and inside the braces of a guarded check. None of the statements after the if run.
  • APP files of one domain can each declare a local { } scope. When all of them carry the same in/out headers, or none, they are interchangeable, and a service that no scope lists takes the first. Scopes with different headers make an unlisted service ambiguous, so list the service in the scope you mean.
  • The order in which .spp, .enum and .app files are staged does not matter. An enum literal such as Status.DONE resolves wherever its enum is declared.

Local transactions without quantum transfers

A LOCAL transaction whose calls take no part in a quantum transfer now commits as a plain JDBC transaction on its shared resource. An unrelated bootstrap journal on another data source is no longer counted as a second JDBC resource. A quantum transfer in a LOCAL transaction still requires the shared resource.

What has not changed

Nothing in the three-layer split moved: SPP states the operation, APP selects realization and PHY supplies resources. These changes tighten what the compiler and runtime verify; they do not claim that every distributed failure mode is covered.