MathGroup Archive 1998

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

Search the Archive

Re: Questions about functions.



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



  • Prev by Date: No Subject
  • Next by Date: Re: Speed of writing in Mathematica 3.01
  • Prev by thread: Questions about functions.
  • Next by thread: Re: Questions about functions.