Changeset 15371


Ignore:
Timestamp:
08/30/20 05:10:56 (2 years ago)
Author:
Mark Evenson
Message:

Expand simplified signalling errors from Java

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Lisp.java

    r15357 r15371  
    428428  }
    429429
    430 
     430  public static final LispObject parse_error(String message) {
     431    return error(new ParseError(message));
     432  }
     433
     434  public static final LispObject simple_error(String formatControl, Object... args) {
     435    LispObject lispArgs = NIL;
     436    for (int i = 0; i < args.length; i++) {
     437      if (args[i] instanceof LispObject) {
     438        lispArgs = lispArgs.push((LispObject)args[i]);
     439      } else if (args[i] instanceof String) {
     440        lispArgs = lispArgs.push(new SimpleString((String)args[i]));
     441      } else {
     442        lispArgs = lispArgs.push(new JavaObject(args[i]));
     443      }
     444    }
     445    lispArgs = lispArgs.nreverse();
     446   
     447    LispObject format = new SimpleString(formatControl);
     448
     449    SimpleError s = new SimpleError(format, lispArgs);
     450    return error(s);
     451  }
    431452
    432453  public static final LispObject type_error(LispObject datum,
Note: See TracChangeset for help on using the changeset viewer.