Basic Examples (3)
Basic Examples
(3)
Declare that a symbol takes exactly two arguments:
myFunc
In[73]:=
When called with the correct number of arguments, the function behaves as normal:
In[74]:=
myFunc[a,b]
Out[74]=
myFunc[a,b]
In[75]:=
myFunc[a_,b_]:={a,b}myFunc[1,2]
Out[76]=
{1,2}
Attempting to evaluate with the incorrect argument count throws an error message and does not evaluate:
myFunc
In[77]:=
myFunc[a,b,c]
Out[77]=
myFunc[a,b,c]
Properties and Relations (1)
Properties and Relations
(1)
Possible Issues (2)
Possible Issues
(2)