✓
Passing This code compiles and runs correctly.
Code
// An [entity] store's `take` mints the taken-obligation; a taken entity with no
// discharger is rejected — the "you can't despawn without saying what despawning
// means" wall. The disposal discipline's teeth, scoped to entity stores (a bare
// store's take is frictionless — see 690_022).
~import std/io
~import std/store
~[entity(enemy)]std/store:new(enemies, capacity: 64) { hp: i64 }
~std/store:insert(enemies) { hp: 9 }
| row r |> std/store:take(enemies[r])
| item i |> std/io:print.ln("took hp {{ i.hp:d }}")
Output must match:
MUST_ERROR
BACKEND_RUNTIME_ERROR
CONTAINS obligation
CONTAINS takenFlows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: enemies, capacity: 64, source: hp: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: enemies, source: hp: 9)
Test Configuration
Expected Error:
Resource 'i' obligation <taken!> was not discharged. No tor accepts <!taken>.