From aa3cbc24934c44da14a0b283a77d9e39564b4c91 Mon Sep 17 00:00:00 2001 From: Joshua Munn Date: Sun, 3 Nov 2024 22:26:21 +0000 Subject: [PATCH] Add temporary fix for run in lang.hy --- src/microkanren/lang.hy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/microkanren/lang.hy b/src/microkanren/lang.hy index 1c52707..20e66ba 100644 --- a/src/microkanren/lang.hy +++ b/src/microkanren/lang.hy @@ -33,8 +33,11 @@ `(fresh ~lvars (&& #* goals))) (defmacro run [n lvars #* goals] - `(lfor state (core.take ~n ((fresh ~lvars ~@goals)(core.empty-state))) - (core.reify (tuple (gfor i (range ~(len lvars)) (core.Var i))) state.sub))) + `(lfor + x + (core.take ~n ((fresh ~lvars ~@goals (fn [s] (core.unit (core.reify ~(tuple lvars) s.sub)))) + (core.empty-state))) + x)) (defmacro run* [lvars #* goals] (hy.macroexpand `(run -1 ~lvars ~@goals)))