Re: Re: What is the purpose of the Defer Command?
- To: mathgroup at smc.vnet.net
- Subject: [mg82147] Re: [mg82122] Re: What is the purpose of the Defer Command?
- From: DrMajorBob <drmajorbob at bigfoot.com>
- Date: Sat, 13 Oct 2007 03:52:56 -0400 (EDT)
- References: <fe4uhp$155$1@smc.vnet.net> <fefhui$j6c$1@smc.vnet.net> <1721082.1192176923906.JavaMail.root@m35>
- Reply-to: drmajorbob at bigfoot.com
How about this? Function[{n}, Print[save[n] = HoldForm[Integrate[x^n Exp[-x], {x, 0, 1}]]]] /@ Range[5]; That gives the same outputs as the Defer example and it allows, for instance, save[3] // ReleaseHold 6 - 16/\[ExponentialE] We can use Defer almost the same way, however: Function[{n}, Print[save[n] = Defer[Integrate[x^n Exp[-x], {x, 0, 1}]]]] /@ Range[5]; First@save[3] 6 - 16/\[ExponentialE] Bobby On Fri, 12 Oct 2007 02:04:49 -0500, Vince Virgilio <blueschi at gmail.com> wrote: > On Oct 9, 5:34 am, "David Park" <djmp... at comcast.net> wrote: >> Still, my question is: "What is the purpose of the Defer Command?" >> >> The only potential purpose that I can see is for didactic purposes, to >> show >> preliminary expressions before they are automatically evaluated. But the >> only way to get Defer to evaluate is by copying and pasting and then >> evaluating, by using Shift-Ctrl-L and then evaluating, or by >> evaluating in >> place. All of these operations leave no record of the steps taken. That >> goes >> contrary to any didactic purpose. >> >> -- >> David Park >> djmp... at comcast.nethttp://home.comcast.net/~djmpark/ > > Have you noticed the example in the documentation (http:// > reference.wolfram.com/mathematica/ref/Defer.html) that uses Defer to > create cells with unevaluated contents? That has didactic potential. > > Can that example be rewritten without Defer, with similar complexity? > > Vince Virgilio > > > -- DrMajorBob at bigfoot.com