Re: Sort problem
- To: mathgroup at smc.vnet.net
- Subject: [mg81716] Re: [mg81678] Sort problem
- From: Syd Geraghty <sydgeraghty at mac.com>
- Date: Tue, 2 Oct 2007 05:35:08 -0400 (EDT)
- References: <200710010849.EAA23017@smc.vnet.net>
Hi Don,
Try just
Sort[{{r, 2}, {a, 3}, {x, 4}}]
Out={{a, 3}, {r, 2}, {x, 4}}
I agree your original code seems like it should work but does not.
Syd Geraghty
On Oct 1, 2007, at 1:49 AM, Donald DuBois wrote:
> Hello,
>
> This Sort works
>
> In[32]:= Sort[{r, a, x}]
>
> Out[32]= {a, r, x}
>
> but this one doesn't:
>
> In[33]:= Sort[{{r, 2}, {a, 3}, {x, 4}}, #1[[1]] < #2[[1]] &]
>
> Out[33]= {{r, 2}, {a, 3}, {x, 4}}
>
>
> What am I doing wrong?
>
> Don
>
- References:
- Sort problem
- From: Donald DuBois <donabc@comcast.net>
- Sort problem