Skip to main content

runmat_runtime/call/
lexical.rs

1use runmat_types::BindingId;
2use runmat_value::Value;
3
4/// One binding-keyed value shared with a lexically nested function.
5#[derive(Clone, Debug, PartialEq)]
6pub struct LexicalCapture {
7    pub binding: BindingId,
8    pub value: Value,
9}
10
11/// Executor-neutral nested-function invocation.
12#[derive(Clone, Debug, PartialEq)]
13pub struct LexicalCall {
14    pub function: usize,
15    pub captures: Vec<LexicalCapture>,
16    pub arguments: Vec<Value>,
17    pub requested_outputs: usize,
18}
19
20/// Nested-function result plus the final value of every shared binding.
21#[derive(Clone, Debug, PartialEq)]
22pub struct LexicalCallResult {
23    pub value: Value,
24    pub captures: Vec<LexicalCapture>,
25}