Evaluation rules and HoldRest
- To: mathgroup at smc.vnet.net
- Subject: [mg42613] Evaluation rules and HoldRest
- From: Matthias <spam at yourself.pl>
- Date: Fri, 18 Jul 2003 05:25:07 -0400 (EDT)
- Organization: Rechenzentrum Uni-Mannheim
- Sender: owner-wri-mathgroup at wolfram.com
Hello, why is this not working as intended? === Assert[bool_, failedExpr_] := If[! bool, Evaluate[failedExpr]]; SetAttributes[Assert, HoldRest]; Assert[1 == 1, Print["Assertion violated!"]]; === The code above prints "Assertion violated". I know that the code behaves correctly when replacing ":=" by "=". I'd like to understand why and would appreciate any explanation, or pointer to relevant documentation. Thanks in advance, Matthias