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 2001

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

Search the Archive

Re: problem with symbol and function declaration

  • To: mathgroup at
  • Subject: [mg30225] Re: problem with symbol and function declaration
  • From: Jens-Peer Kuska <kuska at>
  • Date: Fri, 3 Aug 2001 00:55:57 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <9kavlj$c2q$>
  • Sender: owner-wri-mathgroup at


a) *don't* use such kind of definitions ! over bars, subscripts ..
   and friends are for Input/Output formating *not* for programming !   

OverBar[x] = 2;

test[xx_, sym_:x] = 2*OverBar[sym]*x /. x -> xx;

work as expected. Your definition can't work because

test[x_] = 2*OverBar[x]*x

will never know that the pattern x_ should use first
the symbol x and than replace the symbol x by the value
of the pattern x_.


Martin Richter wrote:
> Hi
> OverBar[x]=2;
> test[x_] = 2*OverBar[x]*x;
> test[1]
> gives
>  _
> 21
> and not 4. So it is like Mathematica is looking at OverBar[x] as two symbols
> and not one ?
> Maybe it is a silly idea so use non ASCII letters for variables.
> Thanks for any comments
> Martin
> ---------------------------------------
> Please remove PET to reply by email

  • Prev by Date: Re: RE: Limit involving square root
  • Next by Date: Crossing plane and cuboid
  • Previous by thread: problem with symbol and function declaration
  • Next by thread: Re: Applying List of Functions To List Of Arguments