]> Repositorios git - scryer-prolog.git/commitdiff
properly thread functors whose first subterm is a variable in thread_goals/4
authorMark Thom <[email protected]>
Sun, 31 Jan 2021 06:37:23 +0000 (23:37 -0700)
committerMark Thom <[email protected]>
Sun, 31 Jan 2021 06:37:23 +0000 (23:37 -0700)
src/loader.pl

index 9360e260a18e5f4c5319ea15f32ac752bf392978..f8f766f7a62a032e4401968c6d76595b3eecbf1c 100644 (file)
@@ -421,7 +421,7 @@ thread_goals(Goals0, Goals1, Functor) :-
 
 thread_goals(Goals0, Goals1, Hole, Functor) :-
     (  var(Goals0) ->
-       Goals0 = Goals1
+       Goals1 =.. [Functor, Goals0, Hole]
     ;  (  Goals0 = [G | Gs] ->
           (  Gs == [] ->
              Goals1 =.. [Functor, G, Hole]