Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Using the same symbol for different quantities

  • To: mathgroup at smc.vnet.net
  • Subject: [mg52375] Using the same symbol for different quantities
  • From: Geronimo <kalymereauKILLSP at Myahoo.fr>
  • Date: Thu, 25 Nov 2004 05:49:47 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Group

I would like to define, e.g.,

        y = f[x]
`       z = g[y]

in such a way that when I type y I get f[x] and when I type z I get g[y], 
and not g[f[x]]. For example from

        Cos[y] + Exp[z]

I would like to obtain

        Cos[f[x]] + Exp[g[y]]

In other words, I would like to use the same symbol (y) for two different 
objects depending on whether y is in the lhs or rhs of the affectation. I 
really need affectations rather than rules for y and z.

I could define different contexts for y. Is there a lighter solution ?

Many thanks

Geronimo
-- 
La possibilité que le oui et le non, le bien et le mal, soient également 
indifférents à Dieu ne peut être concevable pour des têtes faites comme les 
nôtres, car enfin Dieu doit bien servir à quelque chose.
[Jose Saramago]


  • Prev by Date: Re: webMathematica & Dreamweaver
  • Next by Date: Re: Principal Value integral
  • Previous by thread: Re: Compile problem
  • Next by thread: Re: Using the same symbol for different quantities