Q: Union and SameTest Option

*To*: mathgroup at smc.vnet.net*Subject*: [mg16016] Q: Union and SameTest Option*From*: Clemens Frey <btml01 at uni-bayreuth.de>*Date*: Sat, 20 Feb 1999 02:52:06 -0500*Sender*: owner-wri-mathgroup at wolfram.com

Hi Mathematica-Groupers! Can anybody explain to me what's going on here ? In[270]:= Union[ {{a,b,1},{a,c,1},{x,y,2},{a,b,2}}, SameTest->(#1[[2]]===#2[[2]]&) ] Out[270]= {{a,b,1},{a,c,1},{x,y,2}} is ok since the first and the last list element have the same second component. But what is wrong here now ? In[272]:= Union[ {{a,b,1},{a,c,1},{x,y,2},{a,b,2}}, SameTest->(#1[[3]]===#2[[3]]&) ] Out[272]= {{a,b,1},{a,b,2},{a,c,1},{x,y,2}} Thanks in advance Clemens ------------------------------------------------------------ Clemens Frey Doctoral Student at the Department of Mathematics/BITOEK University of Bayreuth(Germany) clemens.frey at uni-bayreuth.de http://www.bitoek.uni-bayreuth.de/~Clemens.Frey ------------------------------------------------------------