Qurak

Substitute values of variables in functions that hold their arguments

Workflow 5 stappen, op volgorde uitgevoerd in één sessie. Elke stap is tegen de engine uitgevoerd en de uitvoer hieronder is wat hij opleverde.

Stap 1
x = 2;
e = Hold[x + 1]
Uitvoer
Hold[x + 1]
Stap 2
x = 4;
ReleaseHold[e]
Uitvoer
5
Stap 3
x = 4;
ReleaseHold[e]
Uitvoer
5
Stap 4
x = 2;
Function[y, x + y]
Uitvoer
Function[y, x + y]
Stap 5
x = 2;
With[{x = x}, Function[y, x + y]]
Uitvoer
Function[y, 2 + y]

Gebruikte functies

Gerelateerde recepten

Alle recepten · Functiereferentie · Gebruik dit vanuit een MCP-client