]> Repositorios git - scryer-prolog.git/commitdiff
compress the definition of freeze:attribute_goals//1
authorMark Thom <[email protected]>
Sat, 30 Nov 2019 21:12:33 +0000 (14:12 -0700)
committerMark Thom <[email protected]>
Sat, 30 Nov 2019 21:12:33 +0000 (14:12 -0700)
src/prolog/lib/freeze.pl
src/prolog/machine/project_attributes.pl

index 049e024b53d22b74cc505041a3162241028b0dde..cca3888dd6e549542a14f2505ed293c7c531384e 100644 (file)
@@ -21,16 +21,6 @@ freeze(X, Goal) :-
     put_atts(Fresh, frozen(Goal)),
     Fresh = X.
 
-gather_freeze_goals(Attrs, _) -->
-    { var(Attrs) },
-    !.
-gather_freeze_goals([frozen(X) | _], Var) -->
-    [freeze(Var, X)],
-    { put_atts(Var, -frozen(_)) },
-    !.
-gather_freeze_goals([_ | Attrs], Var) -->
-    gather_freeze_goals(Attrs, Var).
-
-attribute_goals(X) -->
-    { '$get_attr_list'(X, Attrs) },
-    gather_freeze_goals(Attrs, X).
+attribute_goals(Var) -->
+    { get_atts(Var, frozen(Goals)) },
+    [freeze(Var, Goals)].
index 3882181c702903205d36525448b93d3d59c9ae49..1c0690d5a76cbccda306f01f33b8a044cd70465d 100644 (file)
@@ -63,7 +63,7 @@ call_query_var_goals([AttrVar|AttrVars], Module, Goals) :-
 
 call_attr_var_goals([], _, []).
 call_attr_var_goals([AttrVar|AttrVars], Module, Goals) :-
-    (  catch(Module:attribute_goals(AttrVar, Goals, RGoals),                        
+    (  catch(Module:attribute_goals(AttrVar, Goals, RGoals),
             E,
             '$print_attribute_goals_exception'(Module, E)
             )