class List( int value; List next; ); void printList( List source; ) { print( "{ " ); while ( source != null ) { print( source.value ); source = source.next; if ( source != null ) print( ", " ); } println( " }" ); } void reverseTransferList( int level; List source; var List dest; ) { if ( source == null ) { // At this point } else { dest = new List{ source.value, dest }; reverseTransferList( level + 1, source.next, dest ); // Inside the above invocation } } List source, a2, a4, a7, a9, dest; a9 = new List{ 9, null }; a7 = new List{ 7, a9 }; a4 = new List{ 4, a7 }; a2 = new List{ 2, a4 }; source = a2; reverseTransferList( 0, source, dest ); // Inside this invocation printList( source ); printList( dest );