Re: Problem with matching.
- To: mathgroup at smc.vnet.net
- Subject: [mg53918] Re: [mg53907] Problem with matching.
- From: DrBob <drbob at bigfoot.com>
- Date: Fri, 4 Feb 2005 04:11:13 -0500 (EST)
- References: <200502022310.SAA11969@smc.vnet.net>
- Reply-to: drbob at bigfoot.com
- Sender: owner-wri-mathgroup at wolfram.com
I think it's because the two a_ patterns aren't treated as representing the same a. But this works: F[{x, 2, c}]*F[{x, 1, f}] /. F[{___, a_, ___}]*F[{___, b_, ___}] /; a == b :> yes yes Bobby On Wed, 2 Feb 2005 18:10:51 -0500 (EST), Josef Karthauser <joe at tao.org.uk> wrote: > Can someone tell me why this doesn't match? > > F[{x, 2, c}]F[{x, 1, f}] /. F[{___, a_, ___}]F[{___, a_, ___}] :> yes > > I'm expecting 'yes' to be returned if any of the list arguments to F[] > contain the same value. It doesn't match however; what am I doing > wrong? > > Thanks, > Joe > -- > Josef Karthauser (joe at tao.org.uk) http://www.josef-k.net/ > FreeBSD (cvs meister, admin and hacker) http://www.uk.FreeBSD.org/ > Physics Particle Theory (student) http://www.pact.cpes.sussex.ac.uk/ > ================ An eclectic mix of fact and theory. ================= > > > > > -- DrBob at bigfoot.com www.eclecticdreams.net
- References:
- Problem with matching.
- From: Josef Karthauser <joe@tao.org.uk>
- Problem with matching.