1 import Base 2 import ./captures.bend as Captures 3 import ./local.bend as Local 4 import ./ordinary_app_local_fields.bend as Ord 5 import ./ordinary_resource_system.bend as P 6 import ./world.bend as W 7 import ./transaction.bend as T 8 # Ordinary authored body receives declared capabilities and its runtime capture. 9 # Registration metadata and transaction completion derive from the declaration. 10 def define(~S:Data,~C:Type,~R:Type,~E:Data,~L:Type,~Args:Type,~Error:Data,~Out:Type,~Ops:Type -> Type,~declaration:P.Declaration,E>,Ops(T.Tx,E>)>,~body:@-H:Type -> @-caps:Ops(H) -> L -> Args -> H -> H & (L & (T.Outcome & Out)),world:W.World,name:String,local:L) -> Local.Registered: 11 Captures.register(~S,~C,~R,~E,~L,~Args,~Error,~Out,~Ord.runner(~S,~C,~R,~E,~L,~Args,~Error,~Out,~Ops,~declaration,~body),world,name,P.access(~S,P.clause(~S,~R,~T.Tx,E>,~Ops(T.Tx,E>),declaration)),local)