Re: equaltity of lists
- To: mathgroup at smc.vnet.net
- Subject: [mg19111] Re: [mg19036] equaltity of lists
- From: "David Park" <djmp at earthlink.net>
- Date: Thu, 5 Aug 1999 01:35:27 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Hi Drago,
Mathematica can't tell if {a,b}=={b,a}. If a==b they would be equal. If a not equal
b, they would be unequal. Therefore it leaves the expression unevaluated. You might
want to use {a,b}==={b,a} which test if the structure of each side is the same. It
gives False. Also notice that if you use the test in an If statement you can give a
third branch to the If which is used if the condition evaluates to neither True or
False. Check out Equal, SameQ and If in Help.
>Hi !!
>
>Why don't I get an answer (False) when I ask Mathematica
>
> {a,b}=={b,a}
>
>like the one I get with
>
> {1,2}=={2,1}
> False
>
>Greetings from Croatia,
>Drago Ganic