问题
It seems that SWI-Prolog offers closure expansion. Most likely Jekejeke Prolog 1.4.7 will provide closure expansion as well. We can for example define:
goal_expansion(println(X), (write(X), nl)).
test :- call(println,'Hello World!').
And it will expand println/0 in the first argument of call/2, which has meta specifier closure index 1. Could we use this to make extensible expansion for library(reif)?
This code here rather looks that it cannot work with arbitrary conditions, the predicate ugoal_expansion/2 is not multifile. Closure expansion would make it extensible.
来源:https://stackoverflow.com/questions/65362500/uses-cases-of-closure-expansion-how-about-libraryreif