MathGroup Archive 2004

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

Search the Archive

Changing the Natural Sort Order


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

{a,d,b,c,f}

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 earthlink.net
http://home.earthlink.net/~djmp/ 




  • 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