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

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

Search the Archive

Re: Unevaluated

  • To: mathgroup at smc.vnet.net
  • Subject: [mg44472] Re: [mg44465] Unevaluated
  • From: Anton Antonov <antonov at wolfram.com>
  • Date: Wed, 12 Nov 2003 08:01:23 -0500 (EST)
  • References: <200311110055.TAA25198@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hans-Peter Kunzle wrote:

>Hello,
>
>I was trying to make a function like 'tPrint[x___]' that would act
>like Print if some global variable Testing was True and do nothing
>if Testing was False. This would allow me to simply add or delete
>the 't' to individually turn on or off some tracing. It would
>be easier than to comment or uncomment the Print statements each
>time.
>
>But when I tried
>
>	tPrint[Unevaluated[x___]]:= If[Testing,Print[x]]
>
>I found, using TracePrint, that 'x' gets evaluated each time whether
>or not Testing is True.
>
>Maybe I do not understand properly how Unevaluated operates.
>Is there a way to do what I want?
>
>Any help is appreciated.
>
>Hans
>  
>
If I understand your question correctly, using the attribute HoldAll 
will do the job.

--
Anton Antonov
Wolfram Research, Inc.


  • References:
    • Unevaluated
      • From: Hans-Peter Kunzle <hp.kunzle@ualberta.ca>
  • Prev by Date: Thanks
  • Next by Date: Re: Re: Unformatted File IO
  • Previous by thread: Unevaluated
  • Next by thread: Re: Unevaluated