From 83378e4373b73e4cfc4266b1920d14517ffe984a Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Sat, 15 Jan 2022 11:03:41 -0700 Subject: [PATCH] deduplicate but do not sort anonymous variables in toplevel (#1196) --- src/machine/system_calls.rs | 2 +- src/toplevel.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index 6163a467..67611cc5 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -555,7 +555,7 @@ impl MachineState { let outcome = heap_loc_as_cell!( iter_to_heap_list( &mut self.heap, - seen_set.into_iter().rev(), + seen_set.into_iter(), ) ); diff --git a/src/toplevel.pl b/src/toplevel.pl index b72e0ed1..27783c45 100644 --- a/src/toplevel.pl +++ b/src/toplevel.pl @@ -292,7 +292,7 @@ write_eqs_and_read_input(B, VarList) :- % one layer of depth added for (=/2) functor maplist(\Term^Vs^term_variables_under_max_depth(Term, 22, Vs), Equations, EquationVars), append([AttrGoalVars | EquationVars], Vars1), - sort(Vars1, Vars2), + term_variables(Vars1, Vars2), % deduplicate vars of Vars1 but preserve their order. charsio:extend_var_list(Vars2, VarList, NewVarList0, fabricated), ( bb_get('$first_answer', true) -> write(' '), -- 2.54.0