Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Test for "valid variable"

  • To: mathgroup at
  • Subject: [mg61688] Re: [mg61659] Test for "valid variable"
  • From: Bob Hanlon <hanlonr at>
  • Date: Wed, 26 Oct 2005 01:01:41 -0400 (EDT)
  • Reply-to: hanlonr at
  • Sender: owner-wri-mathgroup at

test={a,B,Pi, E};



Not only must the Head be Symbol but it must not be a symbol for a number.

variableQ[x_] := Head[x]==Symbol&&!NumericQ[x];



Bob Hanlon

> From: Marcus Stollsteimer <marcus314 at>
To: mathgroup at
> Date: 2005/10/24 Mon PM 09:07:20 EDT
> Subject: [mg61688] [mg61659]  Test for "valid variable"
> Hi group,
> I would like to test whether some parameters of functions are
> "valid variables", similar like e.g. in FourierTransform:
>   FourierTransform[t UnitStep[t], t, 1]
>   General::ivar: 1 is not a valid variable.
> Is a test for the head "Symbol" the right thing to do?
> Best regards,
> Marcus
> -- 
> I would have to ask the questioner. I haven't had a chance
> to ask the questioners the question they've been questioning.
>    -- George W. Bush

  • Prev by Date: Re: Re: Warning from Piecewise
  • Next by Date: Re: notebook directory
  • Previous by thread: Re: Integrate vs Nintegrate for impulsive functions
  • Next by thread: IMAP interface to Mathematica