Uses cases of closure expansion, how about library(reif)?

时光毁灭记忆、已成空白 提交于 2021-01-29 12:42:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!