MathGroup Archive 2005

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

Search the Archive

Re: TagSet and the listability of Plus[ ]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61254] Re: TagSet and the listability of Plus[ ]
  • From: albert <awnl at arcor.de>
  • Date: Fri, 14 Oct 2005 05:53:42 -0400 (EDT)
  • References: <diktbh$4ui$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,
 
> I'm pretty sure the reason for this is that the interpreter looks at f1
> + f2 and immediately produces the full form ...
> 
>    List[7, Plus["bar", "tick"]]
> 
> ... which means that the clever downvalue for Plus[ ] does absolutely
> nothing.

I think that you are correct and that this is because the evaluation
procedure works as documented (from the helpbrowser):

o Evaluate the head of the expression.
o Evaluate each element in turn. 
o Apply transformations associated with the attributes Orderless, Listable 
  and Flat. 
o Apply any definitions that you have given.
o Apply any built-in definitions. 
o Evaluate the result. 
 
so the transformations due to the Listable attribute of Plus are applied
before your definition and the only way around that would be to make Plus
not Listable, which I guess is not what you want to do...

hth

albert


  • Prev by Date: Re: How to reverse sign on the y's in a list of (x, y)'s?
  • Next by Date: Re: How to reverse sign on the y's in a list of (x, y)'s?
  • Previous by thread: Re: TagSet and the listability of Plus[ ]
  • Next by thread: Re: TagSet and the listability of Plus[ ]