Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Unsorted Union

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61434] Unsorted Union
  • From: Robert Schoefbeck <schoefbeck at hep.itp.tuwien.ac.at>
  • Date: Wed, 19 Oct 2005 02:16:12 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello all,

in the help section i found the following thing:

UnsortedUnion[x_] := Module[{f}, f[y_] := (f[y] = Sequence[]; y); f/@x]

It does just what it says:
UnsortedUnion[{a,c,b,d,a,b}]={a,c,b,d}

(ordinary Union would Sort the result)

my question is: How does the definition work? I know all the syntax
and i have been using these concepts for for some time now. But i cant 
figure out what this definition does.

Robert


  • Prev by Date: Re: V5.2 or 5.1 slower than v.5.0 for NIntegrate ?
  • Next by Date: Re: Matrices and Conditional Statements
  • Previous by thread: Re: Desperate help
  • Next by thread: Re: Unsorted Union