Skip to content

Commit

Permalink
Return second argument of trace! without evaluation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vsbogd committed Dec 18, 2024
1 parent 2f95fd8 commit a4a1c58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/metta/runner/stdlib/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit a4a1c58

Please sign in to comment.