Post Scriptum language

// Example 3

//  The 'operation' argument is a reference to the 
//  procedure, it can be called as normal procedure
procedure ellipse( x, y, xrad, yrad, startangle, 
                endangle, operation ) {
	newpath();
	savematrix = currentmatrix( matrix() );
	translate( x, y );
	scale( xrad, yrad );
	arc( 0, 0, 1, startangle, endangle );
	setmatrix( savematrix );
	operation();
}

setrgbcolor( 0, 0.7, 0.8 );
ellipse( 144, 400, 72, 144, 0, 360, stroke );
setrgbcolor( 0, 0, 0.8 );
ellipse( 400, 400, 144, 36, 0, 360, fill );
setrgbcolor( 0, 0.8, 0.4 );
ellipse( 300, 180, 144, 72, 30, 150, stroke );
setrgbcolor( 0, 0.8, 0 );
ellipse( 480, 150, 30, 50, 270, 90, fill );

showpage();