From a4a1c58d087d39b988216431e406ab0a48c2aad2 Mon Sep 17 00:00:00 2001 From: Vitaly Bogdanov Date: Wed, 11 Dec 2024 15:37:07 +0300 Subject: [PATCH] Return second argument of trace! without evaluation Evaluating second argument before calling trace! leads to unexpected sequence of traces. Making type of the second argument Atom means argument is evaluated after trace! prints the first argument. --- lib/src/metta/runner/stdlib/debug.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/metta/runner/stdlib/debug.rs b/lib/src/metta/runner/stdlib/debug.rs index 326b04ab..64af9264 100644 --- a/lib/src/metta/runner/stdlib/debug.rs +++ b/lib/src/metta/runner/stdlib/debug.rs @@ -58,7 +58,7 @@ grounded_op!(TraceOp, "trace!"); impl Grounded for TraceOp { fn type_(&self) -> Atom { - Atom::expr([ARROW_SYMBOL, ATOM_TYPE_UNDEFINED, Atom::var("a"), Atom::var("a")]) + Atom::expr([ARROW_SYMBOL, ATOM_TYPE_UNDEFINED, ATOM_TYPE_ATOM, ATOM_TYPE_ATOM]) } fn as_execute(&self) -> Option<&dyn CustomExecute> {