Refactor dump_dim_value() in terms of dump_value().