Why () around Function in pattern?
- To: mathgroup at smc.vnet.net
- Subject: [mg16367] Why () around Function in pattern?
- From: "Kevin Jaffe" <kj0 at mailcity.com>
- Date: Thu, 11 Mar 1999 02:16:42 -0500
- Organization: MailCity (http://www.mailcity.lycos.com:80)
- Sender: owner-wri-mathgroup at wolfram.com
Why does this "work"
In[172]:= q[{x_Integer, y_Integer} ?
(Function[v, v.v > 4])] := qp[x + y]
In[173]:= q[{3, 4}]
Out[173]= qp[7]
while this doesn't?:
In[174]:= qq[{x_Integer, y_Integer} ?
Function[v, v.v > 4]] := qp[x + y]
In[175]:= qq[{3, 4}]
Out[175]= qq[{3, 4}]
I.e., why are ()'s necessary around the pure function
in the arguments pattern?
Thanks,
KJ
Get your FREE Email at http://mailcity.lycos.com
Get your PERSONALIZED START PAGE at http://personal.lycos.com