ABC[x_,y_]:=
If[....,

Clear[ABC]

ABC[x_,y_]/;x^2+y^2≤1:=-4 (* x^2+y^2   A *)

ABC[x_,y_]/;x^2+y^2≤4:= -2(* Cos[Sqrt[x^2+y^2]]  B *)

ABC[x_,y_]/;1<x^2+y^2≤4:=Cos[Sqrt[x^2+y^2]]

ABC[x_,y_]/;x<=0&&y<=0:=Pi (* D *)

ABC[x_/;x<=0,y_/;y<=0]:=Pi

ABC[x_,y_]:=0  (* rest *)

?ABC

DensityPlot[ABC[x,y],{x,-3,3},{y,-3,3},PlotPoints->100]

fib[n_]:=fib[n-1]+fib[n-2]

fib[4]

fib[10]

values=Table[0,{20}];

Clear[fib]

fib[1]=1;
fib[2]=1;

fib[n_]:=
(values[[n]]+=1;
fib[n-1]+fib[n-2])

values

fib[20]

values

Clear[fib]

fib[n_]:=fib[n]=
(values[[n]]+=1;
fib[n-1]+fib[n-2])

?fib

values=Table[0,{20}];

fib[20]

values

?fib

Clear[fib]

fib[n_]:=fib[n]=
fib[n-1]+fib[n-2]

fib[0]=fib[1]=1;

?fib

$RecursionLimit=12000;

fib[10000]

?fib

f[x_]:=x

f[x_,y_]:=x y

f[a_,b_,c_,d_]:=a^b + c^d

?f

f[1,2,3]

h[arg__]:=Plus[arg]

h[4]

Plus[4]

h[1,2,3,4]

Clear[h]

h[args__]:=Length[args]

h[a,b,c,d]

h[args__]:=Length[List[args]]

h[a,b,c,d]

Clear[h]

h[args__]:=Length[{args}]

h[a,b,c,d,e,f,g]

{a,b,c,d}//FullForm

h2[x__]:={x}[[2]]

h2[arg1,arg2,arg3,arg4]

h2[arg1]

Clear[h2]

h2[args__]/;Length[{args}]≥2:={args}[[2]]

h2[arg1,arg2,arg3,arg4]

h2[arg1]

Clear[h2]

{a,b,c,d}[[1]]==First[{a,b,c,d}]

h2[x_,y__]:=First[{y}]

h2[arg1,arg2,arg3,arg4]

h2[arg1]

-> the double underscore does not match an empty list

h3[args__]:=Length[{args}]

h3[arg1]

h3[arg1,arg2,arg3]

h3[]

h4[args___]:=Length[{args}]

h4[]

Clear[h1]

h1[x_,y_,args__]:=y

h1[a,b,c]

h1[a,b]

h1[a]

Clear[h1]

h1[x_,y_,args___]:=y

h1[a,b]

?h1

Clear[h,h1,h2,h3,h4]

(* penultimate = last but one *)

h[args__]:={args}[[Length[

h[args___,x_,y_]:=x   (* pretty! *)

h[1,2,3,4,5,6]

h[1]

h[1,2]

h[args__,y_]:=Last[{args}]

Clear[f]

f[args1__,l_,r_,args2__]/;l>r:=
f[args1,r,l,args2]

f[9,8,7,6,5,4,3]

Clear[f]

f[args1___,l_,r_,args2___]/;l>r:=
f[args1,r,l,args2]

f[6,9,8,7,6,6,6,5,4,3,6]

f[args___]:={args}

f[6,9,8,7,6,6,6,5,4,3,6]

Clear[f]

f[x___]:={x}

f[args1___,l_,r_,args2___]/;l>r:=
f[args1,r,l,args2]

?f

f[6,5,4,3]

f[5,6,4,3]

f[5,4,6,3]

f[4,5,6,3]

f[4,5,3,6]

f[4,3,5,6]

f[3,4,5,6]

?f

Trace[f[6,5,4,3]]//ColumnForm

g[args1___,l_,r_,args2___]/;l>r:=
(Print["args1:",{args1},"; l:",l,"; r:",r,"; args2:",{args2},";"];
g[args1,r,l,args2])

g[1,2,5,3,0]

?g

g[x__]:={x}

g[1,2,5,3,0]