From: Mark Thom Date: Sat, 15 Jan 2022 18:03:41 +0000 (-0700) Subject: deduplicate but do not sort anonymous variables in toplevel (#1196) X-Git-Tag: v0.9.0^2~64 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=83378e4373b73e4cfc4266b1920d14517ffe984a;p=scryer-prolog.git deduplicate but do not sort anonymous variables in toplevel (#1196) --- 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(' '),