Re: pattern test and default value
- To: mathgroup at smc.vnet.net
- Subject: [mg6003] Re: [mg5967] pattern test and default value
- From: seanross at worldnet.att.net
- Date: Sat, 8 Feb 1997 22:38:42 -0500
- Sender: owner-wri-mathgroup at wolfram.com
Marlies wrote: > > Hi, > > It is possible to do the following: > > x_h:v (an expression with head h and default value v) > > Can anyone tell me whether it is possible to have a pattern test like > _?NumberQ AND have a certain default value? > > Regards, > > Marlies Brinksma Try x_:v/;NumberQ[x]. I routinely use this format for things like testing for square matrices of a certain length and input parameter management.