1
$\begingroup$

I define 2 functions:

g[s_][x_,y_] := the gaussian (1) g1[s_,x_,y_] := the gaussian (2) 

I get the same answer using g[s][ x, y] and g1[ s, x, y].
So, what is the difference?
Is there some advantage to be gained in definition 1 over 2?

$\endgroup$
2
  • 1
    $\begingroup$ Possible duplicate: mathematica.stackexchange.com/q/7999/121 $\endgroup$ Commented Jul 17, 2013 at 1:32
  • 2
    $\begingroup$ On the surface, not much. But, they are treated differently by the evaluator, the second (a downvalue) being evaluated before the first (a subvalue). Also, you can add an attribute to a downvalue, but not to a subvalue, without some contortions. $\endgroup$ Commented Jul 17, 2013 at 4:07

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.