Re: Q: extracting list of arguments of function
- To: mathgroup at smc.vnet.net
- Subject: [mg16494] Re: [mg16468] Q: extracting list of arguments of function
- From: "David Park" <djmp at earthlink.net>
- Date: Tue, 16 Mar 1999 03:59:46 -0500
- Sender: owner-wri-mathgroup at wolfram.com
Jerzy, Your problem in extracting the list of arguments to a function, which is passed as an argument, is that Mathematica normally evaluates the arguments of functions. You have to tell it not to by using the HoldFirst attribute. This will work SetAttributes[foo,{HoldFirst}]; foo[_[args___]]:={args} foo[goo[x,y]] {x,y} goo[s_,t_]:=s^2+t^3 foo[goo[x,y]] {x,y} But it you force evaluation... foo[Evaluate[goo[x,y]]] {x^2, y^2} ...because now the actual function that is passed is Plus[x^2, y^2] David Park djmp at earthlink.net http://home.earthlink.net/~djmp/]