Changeset 11295


Ignore:
Timestamp:
08/31/08 10:00:03 (14 years ago)
Author:
ehuelsmann
Message:

Make PACKAGE-ERRORs printable.

Location:
trunk/j/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/PackageError.java

    r11288 r11295  
    3333    {
    3434        super.initialize(initArgs);
     35
     36        if (initArgs.listp() && initArgs.car().stringp()) {
     37           setFormatControl(initArgs.car().getStringValue());
     38           // When printing an error string, presumably, if the string contains
     39           // a symbol, we'll want to complain about its full name, not the accessible
     40           // name, because it may omit an (important) package name part.
     41           // Two problems: (1) symbols can be contained in sublists
     42           //               (2) symbols may not be printed, but used otherwise.
     43           for (LispObject arg = initArgs.cdr(); arg != NIL; arg = arg.cdr()) {
     44              if (arg.car() instanceof Symbol)
     45                 arg.setCar(new SimpleString(((Symbol)arg.car()).getQualifiedName()));
     46           }
     47           setFormatArguments(initArgs.cdr());
     48           setPackage(NIL);
     49
     50           return;
     51        }
     52
    3553        LispObject pkg = NIL;
    3654        LispObject first, second;
  • trunk/j/src/org/armedbear/lisp/package.lisp

    r11294 r11295  
    4242          (progn
    4343            (when (and local-sym (not (eql symbol local-sym)))
    44               (error 'package-error (format nil "Symbol ~S already accessible in package ~S." local-sym (package-name package))))
     44              (error 'package-error
     45                     "Different symbol (~A) with the same name already accessible in package ~A."
     46                     local-sym (package-name package)))
    4547            (if package-supplied-p
    4648                (%import symbol package)
Note: See TracChangeset for help on using the changeset viewer.