描述无论执行多少次都产生相同结果的程序的正确术语是什么 运行?

What is the correct term to describe a procedure that produces the same result irrespective of how many times it is run?

假设您想在数据库中创建一个新的 table。如果您 运行 一个只包含 CREATE... 代码的脚本,那么它将在第一次运行,但如果再次 运行 则崩溃,因为它将尝试创建一个已经存在的对象.但是,通过首先添加 IF EXISTS ... 逻辑(或 DROP TABLE ...),您可以避免此类错误。

我知道有一个特定的技术术语描述了这个概念或 属性,即脚本能够 运行 多次而不改变 [= 的结果的最终结果24=]只用过一次脚本,但我好像想不起来了,也没能找到。 Multi-something-something? or poly-something-something?

Idempotent 操作

can be applied multiple times without changing the result beyond the initial application.

例如,函数 fidempotent 如果对于 所有 输入 x 它持有

f(x) == f(f(x))

我经常在 , and within the context of functional programming as referential transparency 的上下文中遇到这个概念。