Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Substitution in delayed fuctions' topicStudent Support Forum > General > "Substitution in delayed fuctions"

Next Comment >Help | Reply To Topic
Author Comment/Response
MMGM
09/18/10 2:18pm

Hello, is this possible:

Clear[ x, y, z, g , replacement ];

replacement = { y -> z };

g[ x_ , z_ ] := (y * x /. replacement);

---------------------------------------

Ok i know that the behavior of the above code will be, for example:

g[ 2,2 ] = 2 * z (instead of 4)....

Is there any way to force the replacements on the right side of a function without using the operatarod "=" for the function definition ?

Like a "macro" substitution in the c language ...

Thanks in advance,
MIguel

URL: ,

Subject (listing for 'Substitution in delayed fuctions')
Author Date Posted
Substitution in delayed fuctions MMGM 09/18/10 2:18pm
Re: Substitution in delayed fuctions Peter Pein 09/19/10 05:21am
Re: Re: Substitution in delayed fuctions MMGM 09/19/10 9:08pm
Next Comment >Help | Reply To Topic