From 0a6ce352be7d0a8a2cdb2f9a3ae3b0189c5f23b5 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Fri, 19 Dec 2025 21:31:02 -0500 Subject: Add pit_plist_get --- src/runtime.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/runtime.c') diff --git a/src/runtime.c b/src/runtime.c index fcfe81a..86c5fea 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -701,6 +701,15 @@ pit_value pit_contains_eq(pit_runtime *rt, pit_value needle, pit_value haystack) } return PIT_NIL; } +pit_value pit_plist_get(pit_runtime *rt, pit_value k, pit_value vs) { + while (vs != PIT_NIL) { + if (pit_eq(k, pit_car(rt, vs))) { + return pit_car(rt, pit_cdr(rt, vs)); + } + vs = pit_cdr(rt, vs); + } + return PIT_NIL; +} pit_value pit_free_vars(pit_runtime *rt, pit_value bound, pit_value body) { i64 expr_stack_reset = rt->expr_stack->top; -- cgit v1.2.3