MathGroup Archive 2011

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

Search the Archive

Re: Converting a list to arguments for a function --- How?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118672] Re: Converting a list to arguments for a function --- How?
  • From: Jason Ledbetter <jasonbrent at gmail.com>
  • Date: Sat, 7 May 2011 07:30:15 -0400 (EDT)

Not sure if you need something more complicated than just changing the Head.

In[1]:= l = {1, 2, 3, 4}
l /. List -> f
Out[1]= {1, 2, 3, 4}
Out[2]= f[1, 2, 3, 4]



-jbl

On Fri, May 6, 2011 at 7:24 AM, Virgil Stokes <vs at it.uu.se> wrote:

> Suppose I have a list,
>
> list = {4,1,1}
>
> and I wish to use it as follows
>
> f[4,1,1]
>
> Is there a simple way (without looping through the elements list) to
> transfer
> the elements of list to the arguments for f?
>


  • Prev by Date: Problem using a table with Dynamic variables
  • Next by Date: How to use NIntegrate to integrate a purely numeric vector function?
  • Previous by thread: Re: Converting a list to arguments for a function --- How?
  • Next by thread: Re: Converting a list to arguments for a function --- How?