MCPcopy Create free account
hub / github.com/argumentcomputer/ix / lookup_let_val

Method lookup_let_val

crates/kernel/src/tc.rs:489–498  ·  view source on GitHub ↗

Look up a let-bound variable's value, lifted to the current depth. Returns None if the variable is lambda/forall-bound (not a let).

(&mut self, idx: u64)

Source from the content-addressed store, hash-verified

487
488 /// Pop the most recent local variable.
489 pub fn pop_local(&mut self) {
490 if let Some(Some(_)) = self.let_vals.pop() {
491 self.num_let_bindings -= 1;
492 }
493 self.ctx.pop();
494 self.ctx_id = self.ctx_id_stack.pop().unwrap_or_else(empty_ctx_addr);
495 }
496
497 /// Look up a let-bound variable's value, lifted to the current depth.
498 /// Returns None if the variable is lambda/forall-bound (not a let).
499 pub fn lookup_let_val(&mut self, idx: u64) -> Option<KExpr<M>> {
500 let n = self.ctx.len();
501 let idx_us = usize::try_from(idx).ok()?;

Calls 3

liftFunction · 0.85
lenMethod · 0.45
cloneMethod · 0.45