MathGroup Archive 2007

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

Search the Archive

Re: Controlling evaluation

  • To: mathgroup at
  • Subject: [mg83980] Re: Controlling evaluation
  • From: Szabolcs Horvát <szhorvat at>
  • Date: Thu, 6 Dec 2007 02:40:06 -0500 (EST)
  • References: <fiji6s$ikm$> <fim998$run$> <fj65lm$frg$>

Yaroslav Bulatov wrote:
> My own question for the group -- what is the recommended way to define
> a function only for arguments with HoldAll head (like Hold, Condition,
> etc)?

The obvious solution is

fun[completeArg : (head_[___])] /;
   MemberQ[Attributes[head], HoldAll] := something
    (* do something with completeArg *)

But most probably you already know about this solution.  I do not know 
if there are better or more compact ways to do it.


  • Prev by Date: Re: Adding coloured Polygon to a BarChart
  • Next by Date: Re: expressions list -> equations list
  • Previous by thread: Re: Controlling evaluation
  • Next by thread: Re: Notebook programming: SlideShow: emulating bullet at-a-time