Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Changing the Natural Sort Order

  • To: mathgroup at
  • Subject: [mg49144] Changing the Natural Sort Order
  • From: "David Park" <djmp at>
  • Date: Mon, 5 Jul 2004 04:54:23 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Dear MathGroup,

Is it possible to change the natural sort order of symbols that is used in Sort?

I would like something like the following statement (that does not work).

Assuming[d < b < c, Sort[{a, b, c, d, f}]]

giving the desired output


I won't be sorting simple lists of symbols, but lists of similar, but unspecified, expressions that contain the symbols. For example...

{h[x,g[a]], h[x,g[b]], h[x,g[c]], h[x,g[d]], h[x,g[f]]}

which should give

{h[x,g[a]], h[x,g[d]], h[x,g[b]], h[x,g[c]], h[x,g[f]]}

Is there any way to do this?

David Park
djmp at 

  • Prev by Date: LinkInterrupt in C
  • Next by Date: Re: Joining 2D arrays
  • Previous by thread: Re: LinkInterrupt in C
  • Next by thread: Re: Changing the Natural Sort Order