Re: Questions about functions.
- To: mathgroup@smc.vnet.net
- Subject: [mg11808] Re: [mg11801] Questions about functions.
- From: Bob Hanlon <BobHanlon@aol.com>
- Date: Tue, 31 Mar 1998 02:28:27 -0500
In a message dated 3/28/98 6:02:40 AM, 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
>
>
f[x___] := {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) ?
s[x_, y_] := (s + x)*(s + y)
s[E^x, Log[y]]
(s + Exp[x])*(s + Log[y])
However, it is not clear to me what that means. You cannot make a
direct assignment to the symbol s since that would effectively
"overwrite" its definition as a function. You can make an indirect
assignment using a substitution rule (e.g., s[x, y] /. s -> 4)
Bob Hanlon