Changeset 13296 for trunk/abcl/src/org


Ignore:
Timestamp:
05/25/11 14:31:59 (10 years ago)
Author:
Mark Evenson
Message:

Another stab at implementing MERGE-PATHNAME with version.

From a reading of CLtLv2 it seems that I was misinterpretering the
antecedent of "If no version is supplied" as the PATHNAME not the
DEFAULT-PATHNAME.

File:
1 edited

Legend:

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

    r13294 r13296  
    18191819        return mergePathnames(pathname, defaultPathname, Keyword.NEWEST);
    18201820    }
    1821 
     1821   
    18221822    public static final Pathname mergePathnames(final Pathname pathname,
    18231823                                                final Pathname defaultPathname,
    1824                                                 final LispObject defaultVersion) 
     1824                                                final LispObject defaultVersion)
    18251825    {
    18261826        Pathname result;
     
    18871887        //  default-version is nil, the version component will remain
    18881888        //  unchanged."
    1889         if (p.version == NIL && defaultVersion != NIL) {
    1890             result.version = defaultVersion;
    1891         } else if (p.version == NIL && defaultVersion == NIL) {
    1892             result.version = p.version;
    18931889        // "If pathname does not specify a name, then the version, if
    18941890        //  not provided, will come from default-pathname, just like
     
    18971893        //  this process leaves the version missing, the
    18981894        //  default-version is used."
    1899         } else if (p.name == NIL && p.version == NIL) {
    1900             result.version = defaultPathname.version;
    1901         } else if (p.name != NIL) {
    1902             if (defaultVersion != NIL) {
     1895        if (p.version != NIL) {
     1896            result.version = p.version;
     1897        } else if (p.name == NIL) {
     1898            if (defaultPathname.version == NIL) {
    19031899                result.version = defaultVersion;
    19041900            } else {
    1905                 result.version = p.version;
    1906             }
    1907         } else {
    1908             result.version = defaultPathname.version;
     1901                result.version = defaultPathname.version;
     1902            }
     1903        } else if (defaultVersion == NIL) {
     1904            result.version = p.version;
     1905        }
     1906        if (result.version == NIL) {
     1907            result.version = defaultVersion;
    19091908        }
    19101909
Note: See TracChangeset for help on using the changeset viewer.