MathGroup Archive 2002

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

Search the Archive

RE: Apply and Heads option

  • To: mathgroup at smc.vnet.net
  • Subject: [mg35223] RE: [mg35213] Apply and Heads option
  • From: "DrBob" <majort at cox-internet.com>
  • Date: Wed, 3 Jul 2002 05:13:21 -0400 (EDT)
  • Reply-to: <drbob at bigfoot.com>
  • Sender: owner-wri-mathgroup at wolfram.com

You've probably seen this page:

http://documents.wolfram.com/v4/RefGuide/Heads_ex.html

It appears to me that Heads affects pattern matching only -- it
specifies whether matching the head of a sub-expression counts as a
match.  If the pattern is f, does it match twice in f[f] (Heads->True)
or just once (Heads->False)?  It doesn't seem that Apply is sensitive to
that issue.  It applies a function to all expressions of a certain level
(or range of levels) -- not just those that match a pattern.

Bobby

-----Original Message-----
From: Ersek, Ted R [mailto:ErsekTR at navair.navy.mil] 
To: mathgroup at smc.vnet.net
Subject: [mg35223] [mg35213] Apply and Heads option

Hello mathgroup, 
---------

Apply has the Heads option.  
Can somebody give an example where 
Apply[f, expr, Heads->True]   gives a different result than 
Apply[f, expr, Heads->False].

OR where 

Apply[f, expr, levelspec, Heads->True]   gives a different result than 
Apply[f, expr, levelspec, Heads->False].

----------
Thanks,
   Ted Ersek






  • Prev by Date: The Virtues of Collect[--]
  • Next by Date: Examples using Trig option
  • Previous by thread: RE: Apply and Heads option
  • Next by thread: RE: Apply and Heads option