Changeset 15457


Ignore:
Timestamp:
10/29/20 16:54:55 (3 years ago)
Author:
Mark Evenson
Message:

Allows SLIME to load under Windows

Be rigourous about when allowing an :UNSPECIFIC value in a DEVICE as
it only makes sense in non-Windows environments.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
3 edited

Legend:

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

    r15454 r15457  
    384384      rootJar.copyFrom((Pathname)p.getRootJar());
    385385
    386       // Ensure that we don't return a JarPathname if the current default is one
    387       if (rootJar.getDevice().equals(NIL)) {
     386      // Ensure that we don't return a JarPathname if the current
     387      // default is one when we resolve its TRUENAME.  Under Windows,
     388      // the device will get filled in with the DOS drive letter if
     389      // applicable.
     390      if (rootJar.getDevice().equals(NIL)
     391          && !Utilities.isPlatformWindows) {
    388392        rootJar.setDevice(Keyword.UNSPECIFIC);
    389393      }
  • trunk/abcl/src/org/armedbear/lisp/Load.java

    r15455 r15457  
    289289        if (bootPath instanceof Pathname) {
    290290          mergedPathname = (Pathname)Symbol.MERGE_PATHNAMES.execute(pathname, bootPath);
    291           // So PROBE-FILE won't attempt to merge when
     291          // So a PROBE-FILE won't attempt to merge when
    292292          // *DEFAULT-PATHNAME-DEFAULTS* is a JAR
    293           if (mergedPathname.getDevice().equals(NIL)) {
     293          if (mergedPathname.getDevice().equals(NIL)
     294              && !Utilities.isPlatformWindows) {
    294295            mergedPathname.setDevice(Keyword.UNSPECIFIC);
    295296          }
  • trunk/abcl/src/org/armedbear/lisp/Pathname.java

    r15452 r15457  
    540540        }
    541541
    542         if (getDevice() == NIL) {
    543         } else if (getDevice() == Keyword.UNSPECIFIC) {
     542        if (getDevice().equals(NIL)
     543            || getDevice().equals(Keyword.UNSPECIFIC)) {
     544          // nothing emitted for device
    544545        } else if (getDevice() instanceof AbstractString) {
    545546            sb.append(getDevice().getStringValue());
     
    11121113                      || value.equals(Keyword.UNSPECIFIC)
    11131114                      || value.equals(NIL)
    1114                       || value instanceof Cons))
    1115                   error(new TypeError("DEVICE is not a string, :UNSPECIFIC, NIL, or a list.", value, NIL));
     1115                      || value instanceof Cons)) {
     1116                  return type_error("DEVICE is not a string, :UNSPECIFIC, NIL, or a list.",
     1117                                    value,
     1118                                    list(Symbol.OR,
     1119                                         Symbol.STRING, Keyword.UNSPECIFIC, NIL, Symbol.CONS));
     1120                }
    11161121            } else if (key == Keyword.DIRECTORY) {
    11171122                directorySupplied = true;
     
    11211126                    directory = list(Keyword.ABSOLUTE, Keyword.WILD);
    11221127                } else {
    1123                   // a valid pathname directory is a string, a list of strings, nil, :wild, :unspecific
     1128                  // a valid pathname directory is a string, a list of
     1129                  // strings, nil, :wild, :unspecific
     1130                  //
    11241131                  // ??? would be nice to (deftype pathname-arg ()
    1125                   // '(or (member :wild :unspecific) string (and cons ,(mapcar ...
    1126                   // Is this possible?
     1132                  // '(or (member :wild :unspecific) string (and cons
     1133                  // ,(mapcar ...  Is this possible?
    11271134                  if ((value instanceof Cons
    11281135                       // XXX check that the elements of a list are themselves valid
     
    11311138                      directory = value;
    11321139                  } else {
    1133                       error(new TypeError("DIRECTORY argument not a string, list of strings, nil, :WILD, or :UNSPECIFIC.", value, NIL));
     1140                    return
     1141                      type_error("DIRECTORY argument not a string, list of strings, nil, :WILD, or :UNSPECIFIC.",
     1142                                 value,
     1143                                 list(Symbol.OR,
     1144                                      NIL, Symbol.STRING, Symbol.CONS, Keyword.WILD, Keyword.UNSPECIFIC));
    11341145                  }
    11351146                }
     
    11691180            }
    11701181        }
    1171         Pathname p;
     1182        Pathname p; // Pathname is always created in following
     1183                    // resolution for values of HOST
    11721184        LispObject logicalHost = NIL;
    11731185        if (host != NIL) {
     
    11841196                p.setHost(logicalHost);
    11851197            }
    1186             p.setDevice(Keyword.UNSPECIFIC);
     1198            if (!Utilities.isPlatformWindows) {
     1199              p.setDevice(Keyword.UNSPECIFIC);
     1200            }
    11871201        } else {
    11881202            p = Pathname.create();
    11891203        }
     1204       
    11901205        if (device != NIL) {
    11911206            if (p instanceof LogicalPathname) {
    11921207                // "The device component of a logical pathname is always :UNSPECIFIC."
    11931208                if (device != Keyword.UNSPECIFIC) {
    1194                     error(new LispError("The device component of a logical pathname must be :UNSPECIFIC."));
     1209                  return type_error("The device component of a logical pathname must be :UNSPECIFIC.",
     1210                                    p.getDevice(), Keyword.UNSPECIFIC);
    11951211                }
    11961212            } else {
     
    12941310        return p;
    12951311    }
     1312       
    12961313
    12971314
Note: See TracChangeset for help on using the changeset viewer.