Re: A variable defaulting to a previous variable?
- To: mathgroup at smc.vnet.net
- Subject: [mg121971] Re: A variable defaulting to a previous variable?
- From: Simon <simonjtyler at gmail.com>
- Date: Fri, 7 Oct 2011 04:50:29 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <j6jpji$mfe$1@smc.vnet.net>
- Reply-to: comp.soft-sys.math.mathematica at googlegroups.com
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]