MathGroup Archive 1998

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

Search the Archive

Re: Questions about functions.


  • To: mathgroup@smc.vnet.net
  • Subject: [mg11812] Re: Questions about functions.
  • From: bawolk@ucdavis.edu (Bruce Wolk)
  • Date: Tue, 31 Mar 1998 02:28:31 -0500
  • Organization: University of California, Davis
  • References: <6esdkf$57j@smc.vnet.net> <6f1lvm$f9n@smc.vnet.net> <6fi7ca$4ri@smc.vnet.net>

On 28 Mar 1998 02:03:38 -0500, El alchemista
<jaimeco@pecos.rc.arizona.edu> wrote:

>I will appreciate your input to these two questions.
>
>1 - How can I convert the sequence of all arguments of a function  into
>a list ?              In vain I tried      f[x__] := List @@ x 
>
>
>2 - How can I make functions which use their own names , for instance so
>that   s[e,f]   for some symbol   s   and all expressions    e , f   
>becomes    (s+e)(s+f)  ?
>
>
>Many thanks
>
>jaime Combariza
>jaimeco@arizona.edu
>
>
Try this:

In[10]:=
f[x__]:=List[x]
In[11]:=
f[1,2]
Out[11]=
{1,2}
In[12]:=
s[e_,f_]:=(s+e) (s+f)
In[13]:=
s[x,y]
Out[13]=
(s+x) (s+y)


Cheers,

Bruce Wolk



  • Prev by Date: Differential Equations
  • Next by Date: RE: Questions about functions.
  • Prev by thread: Re: Questions about functions.
  • Next by thread: RE: Questions about functions.