MathGroup Archive 2011

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

Search the Archive

Re: A variable defaulting to a previous variable?


Maybe the easiest way would be to define 

f[x_, y_] := x + y
f[x_] := 2 x

Or maybe something like

Module[{yy}, f[x_, y_: yy] := x + y /. yy -> x]



  • Prev by Date: Calendar Info
  • Next by Date: Re: list equation
  • Previous by thread: Re: A variable defaulting to a previous variable?
  • Next by thread: Re: A variable defaulting to a previous variable?