MathGroup Archive 2007

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

Search the Archive

Re: Passing a list as seperate parameters?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg73228] Re: [mg73194] Passing a list as seperate parameters?
  • From: János <janos.lobb at yale.edu>
  • Date: Thu, 8 Feb 2007 03:37:44 -0500 (EST)
  • References: <200702071006.FAA00361@smc.vnet.net>

On Feb 7, 2007, at 5:06 AM, Azumanga wrote:

> I have a recuring problem in using mathematica, which I'm sure there
> must be a simple fix for, but I've looked through the manual and can't
> find it.
>
> As an example, I build up the list { {a,b},{c,d} }, and I want to find
> the union of it's elements.
>
> At first glance, I want Union. However, Union wants it's input as
> Union[{a,b},{c,d}], Union[{{a,b},{c,d}}] doesn't do anything.
>
> In general I get around this by fold, but it seems there should be a
> simpler method?
>

How about Apply ?

In[5]:=
Union @@ lst
Out[5]=
{a, b, c, d}

J=E1nos


--------------------------------------------------------
"Nowadays, security guys break the Mac every single day. Every single =

day, they come out with a total exploit, your machine can be taken 
over totally. I dare anybody to do that once a month on the Windows 
machine."
--Bill Gates, irritated by Apple's comercials
http://www.msnbc.msn.com/id/16934083/site/newsweek/page/2/




  • Prev by Date: Would someone confirm they also see this problem?
  • Next by Date: Re: Integrating SphericalHarmonicY
  • Previous by thread: Re: Passing a list as seperate parameters?
  • Next by thread: Re: Passing a list as seperate parameters?