@Def("showDoc(class is Class)")
@Doc("Displays the documentation for the given class.")
public static class ClassDoc implements Intrinsic {
public Obj invoke(Context context, Obj left, Obj right) {
ClassObj classObj = right.asClass();
StringBuilder builder = new StringBuilder();
builder.append(classObj.getName() + "\n");
if (classObj.getDoc().length() > 0) {
builder.append("| " + classObj.getDoc().replace("\n", "\n| ") + "\n");
} else {
builder.append("| <no doc>\n");
}
System.out.println(builder.toString());