OperationDeclaration

OperationDeclaration[type,op,typedfun]

声明一个类型函数,用于 type 的操作 op.

更多信息

范例

基本范例  (1)

具有一个操作的产品类型声明:

操作声明:

编译一个函数来创建该类型的实例,并编译另一个函数来调用 "Increment" 操作:

创建实例:

调用 "Increment" 操作;返回旧值 0:

再次调用 "Increment" 操作;现在旧值为 1:

Wolfram Research (2024),OperationDeclaration,Wolfram 语言函数,https://reference.wolfram.com/language/ref/OperationDeclaration.html.

文本

Wolfram Research (2024),OperationDeclaration,Wolfram 语言函数,https://reference.wolfram.com/language/ref/OperationDeclaration.html.

CMS

Wolfram 语言. 2024. "OperationDeclaration." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/OperationDeclaration.html.

APA

Wolfram 语言. (2024). OperationDeclaration. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/OperationDeclaration.html 年

BibTeX

@misc{reference.wolfram_2024_operationdeclaration, author="Wolfram Research", title="{OperationDeclaration}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/OperationDeclaration.html}", note=[Accessed: 18-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_operationdeclaration, organization={Wolfram Research}, title={OperationDeclaration}, year={2024}, url={https://reference.wolfram.com/language/ref/OperationDeclaration.html}, note=[Accessed: 18-November-2024 ]}