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 2005

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

Search the Archive

Re: Unsorted Union

  • To: mathgroup at
  • Subject: [mg61474] Re: Unsorted Union
  • From: "Jens-Peer Kuska" <kuska at>
  • Date: Wed, 19 Oct 2005 23:07:22 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <dj4p6t$gpt$>
  • Sender: owner-wri-mathgroup at


the definition of f[] store every argument of f[]
and if f[] is called the first time with a argument
z it return z, for the second call of f[z] it return
a Sequence[] and not z, so that the second (and any future)
appearence of z in x is removed.


"Robert Schoefbeck" 
<schoefbeck at> schrieb im 
Newsbeitrag news:dj4p6t$gpt$1 at
| 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: ListSurfacePlot3D
  • Next by Date: Re: Language vs. Library why it matters
  • Previous by thread: Re: Unsorted Union
  • Next by thread: Re: Unsorted Union