class List( int value; List next; );

void appendText( var []char result; []char text; ) {
	result = result + text;
	}

void buildListText( List a; var []char result; ) {
	if ( a != null ) {
		appendText( result, a.value );
		if ( a.next != null ) {
			appendText( result, ", " );
			buildListText( a.next, result );
			}
		}
	}

List a5 = new List{ 5, null };
List a3 = new List{ 3, a5 };
List a1 = new List{ 1, a3 };
List a = a1;
[]char result = "{ ";
buildListText( a, result );
appendText( result, " }" );
println( result );
