Re: Function defined with If
- To: mathgroup at smc.vnet.net
- Subject: [mg71401] Re: Function defined with If
- From: dh <dh at metrohm.ch>
- Date: Thu, 16 Nov 2006 00:54:53 -0500 (EST)
- Organization: hispeed.ch
- References: <ejevq7$216$1@smc.vnet.net>
Hi Julian, Attributes[If] will tell you that If has the attribute HoldRest what explains you result. However, I can not explain the meaning of this. Daniel Julian Aguirre wrote: > Dear group, > > I am trying to define a function of the variables x, y through other > quantities depending on x and y and the function If. A minimal example > is > > In[1]:= > a = x; > b = y; > f[ x_, y_ ] = If[ a < b, a, b ] > Out[3]= > If[ x < y, a, b ] > > How can I force Mathematica to return If[ x < y, x, y ], as I thought > it would? > > Thaks in advance, > > Julián Aguirre >