Re: trivial question

*To*: mathgroup at smc.vnet.net*Subject*: [mg69809] Re: [mg69798] trivial question*From*: Andrzej Kozlowski <akoz at mimuw.edu.pl>*Date*: Sat, 23 Sep 2006 23:44:57 -0400 (EDT)

On 23 Sep 2006, at 17:44, 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. > If you look at your two outputs in InputForm the reason should be pretty clear. In the first case you have HoldForm[1 + 2 + 3] This has FullForm HoldForm[Plus[1,2,3]]. Now when you convert the first expression to StandardForm (or TraditionalForm) the head HoldForm is hidden the the expression inside HoldForm is displayed in the usual way as 1+2+3 instead Plus[1,2,3], because in StandardForm or in TraditionalForm you always get: In[12]:= Plus[a,b,c] Out[12]= a+b+c In the second case you get HoldForm[Plus][1, 2, 3] (which is the same as its FullForm). In StandardForm (or TraditionalForm) again HoldForm is hidden, but this time the expression Plus inside HoldForm obviously cannot be displayed in any other way, since Plus alone is not never displayed as +, e.g. In[13]:= Plus//TraditionalForm Out[13]//TraditionalForm= Plus Andrzej Kozlowski