RuleDelayed
✖
RuleDelayed
represents a rule that transforms lhs to rhs, evaluating rhs only after the rule is used.
Details
- The character can be entered as :> or ∖[RuleDelayed].
- RuleDelayed has the attribute HoldRest.
- You can apply rules using Replace.
- The assignment lhs:=rhs specifies that the rule lhs:>rhs should be used whenever it applies.
- You can use Condition to specify when a particular rule applies.
- In StandardForm, RuleDelayed is printed using .
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Applications (3)Sample problems that can be solved with this function
Increment n each time x is replaced:
https://wolfram.com/xid/0rs55emga-debnnj
Evaluate the StepMonitor expression separately each time it is to be used:
https://wolfram.com/xid/0rs55emga-bdragr
Generate a diagonal matrix with random elements:
https://wolfram.com/xid/0rs55emga-e232eu
Properties & Relations (6)Properties of the function, and connections to other functions
-> evaluates when it is first entered; :> when it is used:
https://wolfram.com/xid/0rs55emga-ho1ka1
https://wolfram.com/xid/0rs55emga-lcbfnu
Module and With do not affect local variables of RuleDelayed:
https://wolfram.com/xid/0rs55emga-66c43
Module effectively uses a renamed instance of y:
https://wolfram.com/xid/0rs55emga-ip50vi
By evaluating the arguments to RuleDelayed, local scoping is avoided:
https://wolfram.com/xid/0rs55emga-nmten
KeyValuePattern can be used to transform a list of rules:
https://wolfram.com/xid/0rs55emga-q5i9xx
KeyValuePattern distinguishes between Rule and RuleDelayed:
https://wolfram.com/xid/0rs55emga-ev2jo3
Wolfram Research (1988), RuleDelayed, Wolfram Language function, https://reference.wolfram.com/language/ref/RuleDelayed.html (updated 1996).
Text
Wolfram Research (1988), RuleDelayed, Wolfram Language function, https://reference.wolfram.com/language/ref/RuleDelayed.html (updated 1996).
Wolfram Research (1988), RuleDelayed, Wolfram Language function, https://reference.wolfram.com/language/ref/RuleDelayed.html (updated 1996).
CMS
Wolfram Language. 1988. "RuleDelayed." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/RuleDelayed.html.
Wolfram Language. 1988. "RuleDelayed." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/RuleDelayed.html.
APA
Wolfram Language. (1988). RuleDelayed. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RuleDelayed.html
Wolfram Language. (1988). RuleDelayed. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RuleDelayed.html
BibTeX
@misc{reference.wolfram_2024_ruledelayed, author="Wolfram Research", title="{RuleDelayed}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/RuleDelayed.html}", note=[Accessed: 10-January-2025
]}
BibLaTeX
@online{reference.wolfram_2024_ruledelayed, organization={Wolfram Research}, title={RuleDelayed}, year={1996}, url={https://reference.wolfram.com/language/ref/RuleDelayed.html}, note=[Accessed: 10-January-2025
]}