MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: execution model: Function vs. delayed execution

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121355] Re: execution model: Function vs. delayed execution
  • From: Alan <alan.isaac at gmail.com>
  • Date: Mon, 12 Sep 2011 04:20:39 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <j4fhvn$2gr$1@smc.vnet.net> <j4i6d3$c0m$1@smc.vnet.net>
  • Reply-to: comp.soft-sys.math.mathematica at googlegroups.com

On Sunday, September 11, 2011 7:34:59 AM UTC-4, Oleksandr Rasputinov wrote:
> Function employs strict lexical scoping that overrides the HoldFirst  
> attribute of Set:
> 
> In[1] :=
> Function[x, x = DeleteDuplicates[x]; x][{1, 1, 2}] // Trace

[snip]

> this is documented via the statement,
> 
> "Function has attribute HoldAll. The function body is evaluated only after  
> the formal parameters have been replaced by arguments."


*Very* helpful!  I did read that documentation more than once,
but now I understand what it is saying.
Thanks!
Alan Isaac




  • Prev by Date: Rounded-edge textured cubes
  • Next by Date: a question about data plotting
  • Previous by thread: Re: execution model: Function vs. delayed execution
  • Next by thread: Re: execution model: Function vs. delayed execution