Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2185 > unrolled thread

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

Started byJason Ledbetter <jasonbrent@gmail.com>
First post2011-05-07 11:30 +0000
Last post2011-05-07 11:30 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Converting a list to arguments for a function --- How? Jason Ledbetter <jasonbrent@gmail.com> - 2011-05-07 11:30 +0000

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

FromJason Ledbetter <jasonbrent@gmail.com>
Date2011-05-07 11:30 +0000
SubjectRe: Converting a list to arguments for a function --- How?
Message-ID<iq3ag5$fcq$1@smc.vnet.net>
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@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?
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web