MathGroup Archive 2007

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

Search the Archive

Re: Picking Arguments

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74000] Re: Picking Arguments
  • From: "dimitris" <dimmechan at yahoo.com>
  • Date: Mon, 5 Mar 2007 04:51:46 -0500 (EST)
  • References: <esdka9$ou3$1@smc.vnet.net>

In[100]:=
A={f[x], g[p, q, r, s], h[u, v, w]};

I try to find something with Select but in the end I
gave up; all of my attempts were uneccesary complex.
I think Bob Hanlon's solution is the simpler one.

Also

In[109]:=
(#1 /. _[x__] -> {x} & ) /@ A
Out[109]=
{{x}, {p, q, r, s}, {u, v, w}}


Dimitris




=CF/=C7 Mr Ajit Sen =DD=E3=F1=E1=F8=E5:
> Dear MathGroup,
>
>   Given a list of functions
>
>   A={f[x],g[p,q,r,s],h[u,v,w]},
>
>  I'd like to pick out their arguments as a list.
>
>    Cases[A,_[args__]:>{args}]
>
>  works fine returning  {{x}, {p,q,r,s}, {u,v,w}}.
>
>   How do I achieve the same thing with Select ?
>
>
> Thanks for your help.
>
>   Ajit Sen
>
>
>
>
>
> ___________________________________________________________
> Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voic=
email http://uk.messenger.yahoo.com



  • Prev by Date: Re: Copy-paste vector graphics
  • Next by Date: Re: Plot3D
  • Previous by thread: Re: Picking Arguments
  • Next by thread: Re: Picking Arguments