MathGroup Archive 2007

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

Search the Archive

Re: Controlling evaluation

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

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.

-- 
Szabolcs


  • 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