lhs^:=rhs
rhs を lhs の遅延型の値として割り当て,この割当てを lhs の第1レベルに現れるシンボルと結合する.
UpSetDelayed 
lhs^:=rhs
rhs を lhs の遅延型の値として割り当て,この割当てを lhs の第1レベルに現れるシンボルと結合する.
例題
すべて開く すべて閉じる例 (1)
スコープ (6)
左辺 (5)
rand[int] ^:= RandomInteger[]
Table[rand[int], {5}]即時的割当てと遅延的割当てを使って特別な場合と一般的な場合の定義を行う:
f[h[0]] ^= h0;
f[h[x_]] ^:= 2f[h[x - 1]]
f[h[10]]area[sq, s_] ^:= s ^ 2
area[sq, 2]area[sq[s_]] ^:= s ^ 2
area[sq[3]]左辺に複数の記号がある場合,すべての記号について上向きの値が定義される:
method[g[x_], h[y_]] ^:= fgh[x, y]Definition[g]Definition[h]特性と関係 (6)
g/:f[g[x_]] := f1[x]
f[h[x_]] ^:= f2[x]
{UpValues[g], UpValues[h]}タグは1つの上向きの値しか定義しないが,^:=はすべての記号についての定義を行う:
g/:f1[g[x_], h[y_]] := gh[x y]
f2[g[x_], h[y_]] ^:= gh[x y]したがって,g は両方の定義からの上向の値を持つが,h は第2の定義からのものしか持たない:
{UpValues[g], UpValues[h]}rand[int] ^= RandomInteger[];
{rand[int], rand[int]}rand[real] ^:= RandomReal[]
{rand[real], rand[real]}f[h[x_]] ^:= f1[x]
f[h[x_]] ^:= f2[x]
Definition[h]Definitionは記号に関連付けられた定義を出力する:
a_mod + b_mod ^:= modPlus[a, b]
Definition[mod]Informationは定義を含む記号に関するさまざまな情報を出力する:
? modUpValuesは定義された任意の上向きの値に対応する規則のリストを返す:
UpValues[mod]x = 5;
f[h[x_]] ^:= x ^ 2
{f[h[2]], x}g[h[x_]] ^= x ^ 2;
{g[h[2]], x}テクニカルノート
関連するガイド
-
▪
- 割当て
関連するワークフロー
- シンボルや関数の定義を消去する ▪
- 定義された関数をすべて求める
履歴
1988 で導入 (1.0)
テキスト
Wolfram Research (1988), UpSetDelayed, Wolfram言語関数, https://reference.wolfram.com/language/ref/UpSetDelayed.html.
CMS
Wolfram Language. 1988. "UpSetDelayed." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/UpSetDelayed.html.
APA
Wolfram Language. (1988). UpSetDelayed. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/UpSetDelayed.html
BibTeX
@misc{reference.wolfram_2026_upsetdelayed, author="Wolfram Research", title="{UpSetDelayed}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/UpSetDelayed.html}", note=[Accessed: 05-July-2026]}
BibLaTeX
@online{reference.wolfram_2026_upsetdelayed, organization={Wolfram Research}, title={UpSetDelayed}, year={1988}, url={https://reference.wolfram.com/language/ref/UpSetDelayed.html}, note=[Accessed: 05-July-2026]}