Re: check identity of lists
- To: mathgroup at yoda.physics.unc.edu
- Subject: Re: check identity of lists
- From: keiper
- Date: Sat, 28 Aug 93 10:00:29 CDT
> In[4] := %2 == %3 > Out[4] = {True, True} == {True, True} (why not just say "True"?) > In[5] := %2 === %3 > Out[5] = False ??? why not just say "True"? -- Because they are not as is demonstrated by %5. It is not possible to tell from your note either how %2 and %3 were produced or what they really are. OutputForm is not particularly useful when it comes to these sublties. Use instead FullForm, which shows what the expressions really are, albeit often in less readable form. One guess as to what the difference might be (there are many possibilities) is as follows: In[1]:= a = {True, True}; In[2]:= b = "{True, True}"; In[3]:= a == b Out[3]= {True, True} == {True, True} In[4]:= FullForm[%] Out[4]//FullForm= Equal[List[True, True], "{True, True}"] Jerry B. Keiper keiper at wri.com Wolfram Research, Inc.