Re: new function
- To: mathgroup at smc.vnet.net
- Subject: [mg67300] Re: new function
- From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
- Date: Sat, 17 Jun 2006 04:36:13 -0400 (EDT)
- Organization: Uni Leipzig
- References: <e6tc5j$dt8$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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
|