Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

Question about thread

  • To: mathgroup at smc.vnet.net
  • Subject: [mg2581] Question about thread
  • From: sherod at boussinesq.Colorado.EDU (Scott Herod)
  • Date: Mon, 27 Nov 1995 21:31:00 -0500
  • Organization: University of Colorado at Boulder

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