Re: problem with symbol and function declaration
- To: mathgroup at smc.vnet.net
- Subject: [mg30225] Re: problem with symbol and function declaration
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Fri, 3 Aug 2001 00:55:57 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <firstname.lastname@example.org>
- Sender: owner-wri-mathgroup at wolfram.com
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:
> test[x_] = 2*OverBar[x]*x;
> 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
> 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