MathGroup Archive 2004

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

Search the Archive

Re: expresion with variables from a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg50481] Re: [mg50472] expresion with variables from a list
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Mon, 6 Sep 2004 03:59:42 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

f[x_List] := f[Sequence@@x];

list1 = {a, b};
list2 = {a, b, c};

f[list1]

f(a,b)

f[list2]

f(a,b,c)


Bob Hanlon

> 
> From: woutertjuh at hotmail.com (wouter)
To: mathgroup at smc.vnet.net
> Date: 2004/09/05 Sun AM 03:53:48 EDT
> To: mathgroup at smc.vnet.net
> Subject: [mg50481] [mg50472] expresion with variables from a list
> 
> hello, I have what is probably a very easy question. I want to define
> an expression which has as as variables the elements of some
> previously defined list. like for example, if you have lists:
> list1 = {a, b}
> and
> list2 ={a, b, c}
> then I want to define an expression that can evaluate both the
> variables in list one and in list two that is:
> f[list_] := ...,
> which evaluates f[list1] = f[a_, b_] and f[list2] = f[x_,y_,z_].
> 
> this must be pausible in some way, not?
> 
> thanx
> 
> 

Bob Hanlon
Chantilly, VA


  • Prev by Date: Re: expresion with variables from a list
  • Next by Date: not a floating number , gptn complains...
  • Previous by thread: Re: expresion with variables from a list
  • Next by thread: Re: expresion with variables from a list