Changeset 4456


Ignore:
Timestamp:
10/19/03 17:18:30 (19 years ago)
Author:
piso
Message:

LOAD: support pathnames as well as strings.

File:
1 edited

Legend:

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

    r4426 r4456  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Load.java,v 1.23 2003-10-17 13:14:59 piso Exp $
     5 * $Id: Load.java,v 1.24 2003-10-19 17:18:30 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    297297            if (args.length == 0)
    298298                throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
    299             // For now we require a string, but we should also support streams
    300             // and pathnames.
    301             String filename = LispString.getValue(args[0]);
     299            // FIXME Need to support streams as well as pathname designators.
     300            String filename;
     301            if (args[0] instanceof LispString)
     302                filename = ((LispString)args[0]).getValue();
     303            else if (args[0] instanceof Pathname)
     304                filename = ((Pathname)args[0]).getNamestring();
     305            else
     306                throw new ConditionThrowable(new TypeError(args[0], "pathname designator"));
    302307            if (filename.endsWith(".compiled"))
    303308                filename = filename.substring(0, filename.length() - 9);
Note: See TracChangeset for help on using the changeset viewer.