Changeset 9950


Ignore:
Timestamp:
09/08/05 23:31:28 (16 years ago)
Author:
piso
Message:

Logical pathnames: work in progress (tested).

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

Legend:

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

    r9948 r9950  
    33 *
    44 * Copyright (C) 2004-2005 Peter Graves
    5  * $Id: LogicalPathname.java,v 1.9 2005-09-08 18:33:00 piso Exp $
     5 * $Id: LogicalPathname.java,v 1.10 2005-09-08 23:31:28 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    204204    }
    205205
     206    // ""Missing components of wildcard default to :WILD."
     207    protected boolean matches(Pathname wildcard) throws ConditionThrowable
     208    {
     209        if (wildcard.host != Keyword.WILD && wildcard.name != NIL) {
     210            if (!host.equalp(wildcard.host))
     211                return false;
     212        }
     213        if (wildcard.name != Keyword.WILD && wildcard.name != NIL) {
     214            if (!name.equalp(wildcard.name))
     215                return false;
     216        }
     217        if (wildcard.directory != Keyword.WILD && wildcard.directory != NIL) {
     218            if (!directory.equalp(wildcard.directory))
     219                return false;
     220        }
     221        if (wildcard.type != Keyword.WILD && wildcard.type != NIL) {
     222            if (!type.equalp(wildcard.type))
     223                return false;
     224        }
     225        return true;
     226    }
     227
    206228    // ### %make-logical-pathname namestring => logical-pathname
    207229    private static final Primitive _MAKE_LOGICAL_PATHNAME =
  • trunk/j/src/org/armedbear/lisp/Pathname.java

    r9948 r9950  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: Pathname.java,v 1.83 2005-09-08 18:31:25 piso Exp $
     5 * $Id: Pathname.java,v 1.84 2005-09-08 23:31:00 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    486486    }
    487487
    488     private static Pathname parseNamestring(AbstractString namestring)
     488    public static Pathname parseNamestring(AbstractString namestring)
    489489        throws ConditionThrowable
    490490    {
     
    780780            Pathname pathname = coerceToPathname(first);
    781781            Pathname wildcard = coerceToPathname(second);
    782             if (pathname instanceof LogicalPathname || wildcard instanceof LogicalPathname)
    783                 signal(new LispError("Bad place for a logical pathname."));
    784782            return pathname.matches(wildcard) ? T : NIL;
    785783        }
     
    787785
    788786    // ""Missing components of wildcard default to :WILD."
    789     private boolean matches(Pathname wildcard) throws ConditionThrowable
     787    protected boolean matches(Pathname wildcard) throws ConditionThrowable
    790788    {
    791789        if (Utilities.isPlatformWindows()) {
     
    881879    // ### %wild-pathname-p
    882880    private static final Primitive _WILD_PATHNAME_P =
    883         new Primitive("%wild-pathname-p", PACKAGE_SYS, false)
     881        new Primitive("%wild-pathname-p", PACKAGE_SYS, true)
    884882    {
    885883        public LispObject execute(LispObject first, LispObject second)
Note: See TracChangeset for help on using the changeset viewer.