【发布时间】:2020-05-15 07:48:46
【问题描述】:
SICStus Prolog 提供 current_predicate/1 和 current_predicate/2。
manual page 声明:
current_predicate(?PredSpec)
将 PredSpec 与 Name/Arity 形式的谓词规范统一起来。
current_predicate(?Name, ?Term)
将 Name 与用户定义的谓词的名称统一,将 Term 与该谓词对应的最通用术语统一。
它们似乎具有相同的功能: 两个谓词都用于枚举谓词,都适用于模块。
手册页cmets:
current_predicate/1 是 ISO Prolog 标准的一部分; current_predicate/2 不是。
我应该在新(= 非旧版)代码中使用 current_predicate/2 吗?
【问题讨论】:
标签: prolog iso-prolog sicstus-prolog