Re: x=2;Composition[f,FindMinimum][x+1,{x,a}]

*To*: mathgroup at smc.vnet.net*Subject*: [mg68333] Re: x=2;Composition[f,FindMinimum][x+1,{x,a}]*From*: "Chris Chiasson" <chris at chiasson.name>*Date*: Tue, 1 Aug 2006 07:00:06 -0400 (EDT)*References*: <eake8e$qu9$1@smc.vnet.net> <44CDE2C3.6060902@gmail.com>*Sender*: owner-wri-mathgroup at wolfram.com

I was testing to see if I could get around the HoldAll Attribute of FindMinimum by using Composition. Due to the Attributes of Composition, one would think that Composition[FindMinimum][args] would cause args to be evaluated before being caught by FindMinimum's HoldAll. But no. For some reason, it behaves like FindMinimum[args] - some sort of short circuit for performance reasons? Perhaps this optimization should be documented (or maybe it already is and I am too blind to find it). However, based on a Trace someone kindly sent to me, Composition[f,FindMinimum][args] in the older versions do cause the arguments to be evaluated before FindMinimum's HoldAll takes effect. It's just that in the latest version, if f does not also have the attribute HoldAll, then the kernel crashes... Darned if one does, and darned if one doesn't - at least in 5.2 :-) -- http://chris.chiasson.name/