Package com.stuffwithstuff.magpie.interpreter

Examples of com.stuffwithstuff.magpie.interpreter.ClassObj


  }

  @Override
  public Obj invoke(Context context, Obj arg) {
    // Get the class being constructed.
    ClassObj classObj = arg.getField(0).asClass();
    return context.getInterpreter().constructNewObject(
        context, classObj, arg.getField(1));
  }
View Full Code Here


 
  @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());
View Full Code Here

TOP

Related Classes of com.stuffwithstuff.magpie.interpreter.ClassObj

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.