MathGroup Archive 2006

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

Search the Archive

Re: new function


Hi,

yourFunction[a_,{list_}]:= ..

will match to calls like yourFunction[any,{a}],
yourFunction[any,{c}],...

but never to yourFunction[any,{a,b,c}]

You mean
yourFunction[a_,list_List]:= ...

and your function that set all variables in list
to zero should look like

yourFunction[a_,lst:{__Symbol}]:=a /. (#->0 & /@ 
lst)

Regards
  Jens



<gianfred at le.infn.it> schrieb im Newsbeitrag 
news:e6tc5j$dt8$1 at smc.vnet.net...
| Hi,
| I'm writing a package and I want to define a 
function of the form:
| Function[a_,{list_}], where "a" is a generic 
expression of more variables and
| "list" is a list of those variable that must go 
to zero. So in this way,
| Function automatically eliminate the variables 
that I specify after the comma.
| How can I create this function?
| Thanks,
| Maria
| 



  • Prev by Date: Re: vertical or perpendicular offets?
  • Next by Date: Re: standard errors and confidence intervals in NonlinearRegress
  • Previous by thread: Re: new function
  • Next by thread: vertical or perpendicular offets?