]> Repositorios git - scryer-prolog.git/commitdiff
Fix anonymous attributed variables not showing in toplevel #2241
authorbakaq <[email protected]>
Fri, 22 Dec 2023 16:07:09 +0000 (13:07 -0300)
committerbakaq <[email protected]>
Fri, 22 Dec 2023 16:07:09 +0000 (13:07 -0300)
src/toplevel.pl

index 4e242076682c555af3d5cb8774542cafcaaa33b7..997ebad9e144d3967532a11e3e3fac8ab3971cdf 100644 (file)
@@ -314,9 +314,11 @@ write_eqs_and_read_input(B, VarList, AttrVars) :-
     % one layer of depth added for (=/2) functor
     '$term_variables_under_max_depth'(OrigVars, 22, Vars0),
     '$project_atts':project_attributes(Vars0, AttrVars),
-    % need to copy all the visible Vars here so that they appear
-    % properly in AttrGoals, even the non-attributed.
-    copy_term(Vars0, Vars0, AttrGoals),
+    % Need to copy all the visible Vars here so that they appear
+    % properly in AttrGoals, even the non-attributed. Need to also
+    % copy all the attributed variables here so that anonymous
+    % attributed variables also appear properly in AttrGoals.
+    copy_term([Vars0, AttrVars], [Vars0, AttrVars], AttrGoals),
     term_variables(AttrGoals, AttrGoalVars),
     append([Vars0, AttrGoalVars, AttrVars], Vars),
     charsio:extend_var_list(Vars, VarList, NewVarList, fabricated),