MathGroup Archive 2006

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

Search the Archive

Re: trivial question


dimmechan at yahoo.com wrote:
> Hi.
> 
> I think this is rather trivial, but I can think something right now.
> 
> Why the commands below result in different output?
> 
> (HoldForm[+##1]&)@@list
> 1+2+3
> 
> HoldForm[Plus]@@list
> Plus[1,2,3]
> 
> Thanks in advance.

The first expression's FullForm is (assuming list={1,2,3}):

HoldForm[Plus[1,2,3]]

while the second expression is:

HoldForm[Plus][1,2,3]

In the first case HoldForm formats Plus[1,2,3] without evaluation to get 
1+2+3. In the second case HoldForm formats Plus without evaluation to 
get Plus. However, there is no formatting rule (MakeBoxes) for the head 
HoldForm[Plus], so no further formatting occurs.

Carl Woll
Wolfram Research


  • Prev by Date: Re: Pure function in a pure function (again)
  • Next by Date: Copying cell contents?
  • Previous by thread: trivial question
  • Next by thread: Re: trivial question