OneIdentity
✖
OneIdentity
詳細

- PlusやTimesのような関数には,属性OneIdentityが与えられている.
- Timesに属性としてOneIdentityが与えられていることにより,n_.x_のようなパターンがxに適合することができる.
例題
すべて開くすべて閉じる例 (1)基本的な使用例
Timesには属性OneIdentityがあるのでパターンはマッチする:

https://wolfram.com/xid/0h2qub6zeq-if31j7


https://wolfram.com/xid/0h2qub6zeq-b74h4b

属性OneIdentityを持つ関数はどれでもマッチする:

https://wolfram.com/xid/0h2qub6zeq-fidp4m

https://wolfram.com/xid/0h2qub6zeq-pisx7w

特性と関係 (2)この関数の特性および他の関数との関係
OneIdentityはTimesを全く含まない式にデフォルトを適用することを許す:

https://wolfram.com/xid/0h2qub6zeq-7r9we


https://wolfram.com/xid/0h2qub6zeq-mj5e8n

Flat関数については,引数の任意の列がBlankにマッチする:

https://wolfram.com/xid/0h2qub6zeq-dcb16u

https://wolfram.com/xid/0h2qub6zeq-bhykd6

f が同時にFlatかつOneIdentityである場合,f[x_]は x_と f[a]ではなく a をマッチしようとする:

https://wolfram.com/xid/0h2qub6zeq-co9ya1

https://wolfram.com/xid/0h2qub6zeq-uihwtk

考えられる問題 (1)よく起る問題と予期しない動作
f[a]と a をマッチするためには,Optionalを含むパターンを使わなくてはならない:

https://wolfram.com/xid/0h2qub6zeq-m92rcb

https://wolfram.com/xid/0h2qub6zeq-cll0ea


https://wolfram.com/xid/0h2qub6zeq-orrb7h

同様に,次のパターン f に定義済みのデフォルトがないのではうまくいかない:

https://wolfram.com/xid/0h2qub6zeq-ljmrxw


https://wolfram.com/xid/0h2qub6zeq-1g7wwj


https://wolfram.com/xid/0h2qub6zeq-6w0lw3

Wolfram Research (1988), OneIdentity, Wolfram言語関数, https://reference.wolfram.com/language/ref/OneIdentity.html (2003年に更新).
テキスト
Wolfram Research (1988), OneIdentity, Wolfram言語関数, https://reference.wolfram.com/language/ref/OneIdentity.html (2003年に更新).
Wolfram Research (1988), OneIdentity, Wolfram言語関数, https://reference.wolfram.com/language/ref/OneIdentity.html (2003年に更新).
CMS
Wolfram Language. 1988. "OneIdentity." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2003. https://reference.wolfram.com/language/ref/OneIdentity.html.
Wolfram Language. 1988. "OneIdentity." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2003. https://reference.wolfram.com/language/ref/OneIdentity.html.
APA
Wolfram Language. (1988). OneIdentity. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OneIdentity.html
Wolfram Language. (1988). OneIdentity. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OneIdentity.html
BibTeX
@misc{reference.wolfram_2025_oneidentity, author="Wolfram Research", title="{OneIdentity}", year="2003", howpublished="\url{https://reference.wolfram.com/language/ref/OneIdentity.html}", note=[Accessed: 10-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_oneidentity, organization={Wolfram Research}, title={OneIdentity}, year={2003}, url={https://reference.wolfram.com/language/ref/OneIdentity.html}, note=[Accessed: 10-May-2025
]}