MathGroup Archive 2005

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

Search the Archive

Re: how to map function with over 1 arguments to list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57211] Re: [mg57205] how to map function with over 1 arguments to list
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sat, 21 May 2005 02:39:24 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

f[x_,y_]:=x+y;

f@@@{{1,1},{2,2}}

{2,4}

f@@#&/@{{1,1},{2,2}}

{2,4}

f[#[[1]],#[[2]]]&/@{{1,1},{2,2}}

{2,4}

f[Sequence@@#]&/@{{1,1},{2,2}}

{2,4}


Bob Hanlon

> 
> From: "xun" <xiaoxun at gmail.com>
To: mathgroup at smc.vnet.net
> Date: 2005/05/20 Fri AM 04:44:30 EDT
> Subject: [mg57211] [mg57205] how to map function with over 1 arguments to list
> 
> Hi, all,
> 
> g[x_]:=x^2;
> g/@{1,2,3} results in{1,4,9}
> 
> similarly, how to map f[x_,y_]:=x+y;
> to {1,1},{2,2}?
> 
> it seems that f/@{{1,1},{2,2}} doesn't work.
> 
> Thx.
> Xun
> 
> 
> 
> 
> 


  • Prev by Date: Re: how to map function with over 1 arguments to list
  • Next by Date: Re: how to map function with over 1 arguments to list
  • Previous by thread: Re: how to map function with over 1 arguments to list
  • Next by thread: Re: how to map function with over 1 arguments to list