Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • $\begingroup$ You might want to add a note that WithStackFrame needs attribute HoldAll for the test case to work as stated. $\endgroup$ Commented Feb 23, 2012 at 16:28
  • $\begingroup$ @Albert I'd say, HoldFirst rather than HoldAll, to allow the body to evaluate. $\endgroup$ Commented Feb 23, 2012 at 16:36
  • $\begingroup$ @Leonid: actually now that I think about it even HoldFirst seems not really necessary, it was my mistake (I had a definition for x hanging around) that caused it was needed in the first place. Once the function does what it is supposed, the actual arguments will be used so the hold attribute should usually not be necessary at all, so it might be best to ignore my comment... $\endgroup$ Commented Feb 23, 2012 at 17:22
  • $\begingroup$ @Albert Yes, but the arguments passed to the first argument of WithStackFrame, may be expressions which may evaluate (the function being executed may be HoldAll itself), so in that case HoldFirst for WithStackFrame would prevent that. $\endgroup$ Commented Feb 23, 2012 at 18:12