Re: -> {"AX", "!D", "EX"}
- To: mathgroup at smc.vnet.net
- Subject: [mg76127] Re: -> {"AX", "!D", "EX"}
- From: dimitris <dimmechan at yahoo.com>
- Date: Wed, 16 May 2007 05:45:17 -0400 (EDT)
- References: <f26nv5$4cl$1@smc.vnet.net><200705140753.DAA23316@smc.vnet.net>
.=2E. You have entered the Twilight Zone Beyond this world strange things are known Use the key, unlock the door See what your fate might have in store Come explore your dreams' creation Enter this world of imagination .=2E.. Rush 2112 Lp (1976) Dimitris PS A song that describes perfectly Mathematica's Ordering (in some advanced issues!) Don't you agree? =CF/=C7 Murray Eisenberg =DD=E3=F1=E1=F8=E5: > The docs cited DO seem to say how strings are ordered: "as they would be > in a dictionary....". > > Is "!" a "mathematical operator" or is it just a character in the > examples at issue? > > With dictionary ordering, the primary key for sorting would be the first > character. So none of this explains the discrepant behavior between "!" > as a single character and "!" as the first character of a string. > > Szabolcs wrote: > > Philipp wrote: > >> Would anybody explain to me the Mathematica (5.2) canonical order. > >> Specifically, why > >> > >> In[]:= Sort[{"AX", "!D", "EX"}] > >> Out[]= {"AX", "!D", "EX"} > >> > >> while, > >> > >> In[]:= Sort[{"A", "!", "E"}] > >> Out[]= {"!", "A", "E"} > >> > >> Is this a bug??? > >> > >> Cheers, > >> > >> Philipp. > >> > >> > > > > http://documents.wolfram.com/mathematica/book/section-A.3.9 > > > > Most probably it has to do something with the "Mathematical operators > > appear in order of decreasing precedence." part. > > This behaviour is too consistent to be a bug (i.e. unintended > > behaviour), but it is really confusing. The documentation only mentions > > the ordering of single characters, but not how longer strings are > > treated, and it seems that it doesn't work as most people would expect > > it to. > > > > -- > Murray Eisenberg murray at math.umass.edu > Mathematics & Statistics Dept. > Lederle Graduate Research Tower phone 413 549-1020 (H) > University of Massachusetts 413 545-2859 (W) > 710 North Pleasant Street fax 413 545-1801 > Amherst, MA 01003-9305
- References:
- Re: Why Sort[{"AX", "!D", "EX"}] -> {"AX", "!D", "EX"} ?
- From: Szabolcs <szhorvat@gmail.com>
- Re: Why Sort[{"AX", "!D", "EX"}] -> {"AX", "!D", "EX"} ?