MathGroup Archive 1995

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

Search the Archive

Question about thread


I have a question about the way Thread behaves.  From the description
in the _Mathematica_ book, I would expect it to return lists.  For
example

Mathematica 2.2 for Solaris
Copyright 1988-93 Wolfram Research, Inc.
License valid through 28 Nov 1995.
 -- Open Look graphics initialized -- 

In[1]:= Thread[f[{a,b},x]]

Out[1]= {f[a, x], f[b, x]}


But that doesn't always seem to be the case.

In[2]:= blat[p_, q_] := Module[{}, Plus @@ (Variables[p]^q)]

In[3]:= blat[a+b,x]

         x    x
Out[3]= a  + b

In[4]:= Thread[blat[{a+c,b+d},x]]

         x    x    x    x
Out[4]= a  + b  + c  + d

Why isn't Out[4] the same as

In[5]:= Outer[blat, {a+c, b+d} , {x}] // Flatten

          x    x   x    x
Out[5]= {a  + c , b  + d }


Scott Herod
Applied Mathematics
University of Colorado, Boulder
sherod at colorado.edu


  • Prev by Date: Limiting mma caching (??)
  • Next by Date: Re: [Q] {a,b,c}->{{a,b},{b,c}}
  • Previous by thread: Question about thread
  • Next by thread: Re: Question about thread