Hi,
It is true that Alan has already answered this question but I was misled because the file that I compiled without problem is this one, even leaving pair z[ ] (I can think that it is because of this instruction z := point 3.6 of p ;)
\starttext
\startMPpage[offset=2pt]
path p, q, r, b ; pair z ;
p := unitsquare scaled 4cm ;
z := point 3.6 of p ;
q := z--urcorner p ;
r := z--urcorner p-- reverse bottomboundary p--cycle ;
b := reverse bottomboundary p ;
%r := q -- reverse bottomboundary p -- cycle ; definition of Hans
draw b--q withpen pencircle scaled 1mm withcolor red ;
draw p ;
draw r numberstriped (.25,10,5) withcolor magenta ;
label.llft("B", p) ;
label.lrt("C", p) ;
label.ulft("A", p) ;
label.urt("D", p) ;
label.lft("M", p) ;
\stopMPpage
\startMPpage[offset=2pt]
defaultfont := "texgyrepagella-regular*default" ;
defaultscale :=0.8 ;
path p, q, r, b ; pair z[];
p := unitsquare xyscaled (9cm,5cm) ;
z[0] = (2cm,0cm) ;
z[1] = (2cm,2cm) ;
z[2] = (0cm,2cm) ;
q := llcorner p--z[0]--z[1]--z[2]--cycle ;
r := unitsquare xyscaled (7cm,3cm) shifted(2cm,2cm) ;
b := z[2]--z[1]--ulcorner r--urcorner p--lrcorner r--z[1]--z[0]--llcorner p--cycle ;
draw p ;
draw b numberstriped (.25,15,5) withcolor magenta ;
label.llft("A", p) ;
label.lrt("D", p) ;
label.ulft("C", p) ;
label.urt("B", p) ;
label.lft("M", z[2]) ;
label.ulft("N", z[1]) ;
label.bot("P", z[0]) ;
label.top("J", ulcorner r) ;
label.rt("I", lrcorner r) ;
label.bot(btex $x$ etex,(llcorner p+z[0])/2);
label.lft(btex $x$ etex,(llcorner p+z[2])/2);
\stopMPpage
\stoptext