Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*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 2006

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

Search the Archive

Re: HoldFirst confusion

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65537] Re: HoldFirst confusion
  • From: Jon Harrop <usenet at jdh30.plus.com>
  • Date: Thu, 6 Apr 2006 06:53:16 -0400 (EDT)
  • References: <e1095n$lkf$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Yaroslav Bulatov wrote:
> The following gives an error
> f = 5; f[a_] = a
> 
> Set is HoldFirst, so why does it evaluate it's first argument f[a_]?

Conversely, why do the attributes of Set and SetDelayed indicate that they
hold their first argument when the kernel evaluates it.

On a related note, how can you define and use a downvalue that matches
g[1+2] without evaluating the 1+2?

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/ocaml_for_scientists/chapter1.html


  • Prev by Date: Speed: Inner MUCH slower than dot product??
  • Next by Date: Re: HoldFirst question
  • Previous by thread: HoldFirst confusion
  • Next by thread: Re: Re: HoldFirst confusion