MathGroup Archive 2006

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

Search the Archive

Re: Problems with Set, SetDelayed and replacement rules...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg72283] Re: Problems with Set, SetDelayed and replacement rules...
  • From: Johan Grönqvist <johan.gronqvist at gmail.com>
  • Date: Mon, 18 Dec 2006 06:55:52 -0500 (EST)
  • References: <em3a6c$7fq$1@smc.vnet.net>

Johannes skrev:

> f[x_]:= g/h*x;
> g[p_]= 1+p;
> h[p_]=1+p^2;
> params={g->g[p],h->h[p]};
> [...]
> f3[x_, p_] := f[x] /. params;
> 
> If I am now calculating [...], for f3[1,1] p isn't replaced by its value 1.
> 
> Can anybody explain me the differences, especially the differences between f2 and f3? I suspected it to be exactly identical. 

Sorry. I cannot explain this, but it seems to work for me.

f3[x_, pp_] := (f[x] /. params) //. p -> pp

I thought params := ... instead of params = ... would be enough, but it 
seems it was not.

/ johan


  • Prev by Date: Re: simplifying inequalities
  • Next by Date: Re: simplifying inequalities
  • Previous by thread: Re: Problems with Set, SetDelayed and replacement rules...
  • Next by thread: Re: Problems with Set, SetDelayed and replacement rules...