WLJS LogoWLJS Notebook

UpSetDelayed

lhs ^:= rhs assigns rhs to be the delayed value of lhs, and associates the assignment with symbols that occur at level one in lhs.

Examples

Delayed upvalue assignment:

Format[myType[x_]] ^:= Style[x, Red, Bold];
myType["hello"]

Define behavior for nested pattern:

f[g[x_]] ^:= x + 1;
f[g[5]]
(* 6 *)

Please visit the official Wolfram Language Reference for more details.

On this page