Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: Thread and MapThread

  • To: mathgroup at
  • Subject: [mg29874] Re: [mg29868] Thread and MapThread
  • From: Andrzej Kozlowski <andrzej at>
  • Date: Sun, 15 Jul 2001 00:59:00 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

The problem is that both functions Thread and MapThread evaluate their
arguments. In the case of MapThread and this particular example it is
harmless but it the case of Thread this is what happens:

Thread[ftest[{x1, x2, x3}, {y1, y2, y3}]]//Trace

So what you need to do is:

Thread[Unevaluated[ftest[{x1, x2, x3}, {y1, y2, y3}]]]

Andrzej Kozlowski
Toyama International University

on 01.7.14 2:36 PM, David Park at djmp at wrote:

> Dear MathGroup,
> Here is a function:
> ftest[x_, y_] := {f1[x], f2[y]}
> Why does the following work...
> MapThread[ftest, {{x1, x2, x3}, {y1, y2, y3}}]
> {{f1[x1], f2[y1]}, {f1[x2], f2[y2]}, {f1[x3], f2[y3]}}
> ...but the following does not work.
> Thread[ftest[{x1, x2, x3}, {y1, y2, y3}]]
> {f1[{x1, x2, x3}], f2[{y1, y2, y3}]}
> David Park
> djmp at

  • Prev by Date: Re: Thread and MapThread
  • Next by Date: webMathematica Script Wizards
  • Previous by thread: Re: Thread and MapThread
  • Next by thread: Re: Thread and MapThread