Changeset 9994


Ignore:
Timestamp:
09/22/05 00:17:38 (16 years ago)
Author:
piso
Message:

translateLogicalPathname()
SYS:CANONICALIZE-LOGICAL-HOST

File:
1 edited

Legend:

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

    r9992 r9994  
    33 *
    44 * Copyright (C) 2004-2005 Peter Graves
    5  * $Id: LogicalPathname.java,v 1.17 2005-09-21 17:36:15 piso Exp $
     5 * $Id: LogicalPathname.java,v 1.18 2005-09-22 00:17:38 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    123123        }
    124124        return new SimpleString(s.getStringValue().toUpperCase());
     125    }
     126
     127    public static Pathname translateLogicalPathname(LogicalPathname pathname)
     128        throws ConditionThrowable
     129    {
     130        return (Pathname) Symbol.TRANSLATE_LOGICAL_PATHNAME.execute(pathname);
    125131    }
    126132
     
    254260    }
    255261
     262    // ### canonicalize-logical-host host => canonical-host
     263    private static final Primitive CANONICALIZE_LOGICAL_HOST =
     264        new Primitive("canonicalize-logical-host", PACKAGE_SYS, true, "host")
     265    {
     266        public LispObject execute(LispObject arg)
     267            throws ConditionThrowable
     268        {
     269            try {
     270                AbstractString s = (AbstractString) arg;
     271                if (s.length() == 0)
     272                    return signal(new LispError("Invalid logical host name: \"" +
     273                                                s.getStringValue() + '"'));
     274                return canonicalizeStringComponent(s);
     275            }
     276            catch (ClassCastException e) {
     277                return signalTypeError(arg, Symbol.STRING);
     278            }
     279        }
     280    };
     281
    256282    // ### %make-logical-pathname namestring => logical-pathname
    257283    private static final Primitive _MAKE_LOGICAL_PATHNAME =
    258         new Primitive("%make-logical-pathname", PACKAGE_SYS, true,
    259                       "namestring")
     284        new Primitive("%make-logical-pathname", PACKAGE_SYS, true, "namestring")
    260285    {
    261286        public LispObject execute(LispObject arg)
Note: See TracChangeset for help on using the changeset viewer.