diff options
Diffstat (limited to 'tvix/eval/src/value')
-rw-r--r-- | tvix/eval/src/value/function.rs | 4 | ||||
-rw-r--r-- | tvix/eval/src/value/mod.rs | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/tvix/eval/src/value/function.rs b/tvix/eval/src/value/function.rs index d0209cc50725..e5db43d58ace 100644 --- a/tvix/eval/src/value/function.rs +++ b/tvix/eval/src/value/function.rs @@ -29,7 +29,7 @@ impl Lambda { #[derive(Clone, Debug)] pub struct InnerClosure { - pub lambda: Lambda, + pub lambda: Rc<Lambda>, pub upvalues: Vec<Value>, } @@ -38,7 +38,7 @@ pub struct InnerClosure { pub struct Closure(Rc<RefCell<InnerClosure>>); impl Closure { - pub fn new(lambda: Lambda) -> Self { + pub fn new(lambda: Rc<Lambda>) -> Self { Closure(Rc::new(RefCell::new(InnerClosure { upvalues: Vec::with_capacity(lambda.upvalue_count), lambda, diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs index 54211e8ba313..911af9d6ae12 100644 --- a/tvix/eval/src/value/mod.rs +++ b/tvix/eval/src/value/mod.rs @@ -35,6 +35,7 @@ pub enum Value { AttrPath(Vec<NixString>), AttrNotFound, DynamicUpvalueMissing(NixString), + Blueprint(Rc<Lambda>), } impl Value { @@ -55,9 +56,10 @@ impl Value { Value::Closure(_) | Value::Builtin(_) => "lambda", // Internal types - Value::AttrPath(_) | Value::AttrNotFound | Value::DynamicUpvalueMissing(_) => { - "internal" - } + Value::AttrPath(_) + | Value::AttrNotFound + | Value::DynamicUpvalueMissing(_) + | Value::Blueprint(_) => "internal", } } @@ -166,6 +168,7 @@ impl Display for Value { // internal types Value::AttrPath(path) => write!(f, "internal[attrpath({})]", path.len()), Value::AttrNotFound => f.write_str("internal[not found]"), + Value::Blueprint(_) => f.write_str("internal[blueprint]"), Value::DynamicUpvalueMissing(name) => { write!(f, "internal[no_dyn_upvalue({name})]") } |