[Turn on line numbering]
arg value;
var s, i, len;
refresh();
switch (type(value)) {
case 'list:
if (!value)
return ["[]"];
s = map i in [1 .. (len = value.length())] to (.unparse_indent(value[i]).affix(i < len ? "," : "")).sum();
s ?= [];
if (s.mmap('length).sum() < 60) {
return ["[" + s.join() + "]"];
} else {
s = s.prefix(" ");
s = s.replace(1, s[1].subrange(3));
return ["[ "].affix(s).affix("]");
}
case 'dictionary:
s = map i in [1 .. (len = value.keys().length())] to (.unparse_indent([(value.keys())[i], value[(value.keys())[i]]]).affix(i < len ? "," : "")).sum();
s ?= [];
if (s.mmap('length).sum() < 60) {
return ["#[" + s.join() + "]"];
} else {
s = s.prefix(" ");
s = s.replace(1, s[1].subrange(3));
return ["#["].affix(s).affix("]");
}
case 'frob:
return ["<"].affix(class(value)).affix(",").affix(.unparse_indent(value.value())).affix(">");
default:
return [toliteral(value)];
}
// $#Edited: 21 Aug 97 20:25 $miro
["// Created 07-Dec-1996 as a part of ColdCore, see: @help Credit"]