Changeset 4083


Ignore:
Timestamp:
09/27/03 18:29:24 (19 years ago)
Author:
piso
Message:

inSynonymOf(), outSynonymOf()

File:
1 edited

Legend:

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

    r4078 r4083  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Lisp.java,v 1.152 2003-09-26 18:48:00 piso Exp $
     5 * $Id: Lisp.java,v 1.153 2003-09-27 18:29:24 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    788788    }
    789789
     790    public static final CharacterInputStream inSynonymOf(LispObject obj)
     791        throws ConditionThrowable
     792    {
     793        if (obj == T)
     794            return checkInputStream(_TERMINAL_IO_.symbolValue());
     795        if (obj == NIL)
     796            return checkInputStream(_STANDARD_INPUT_.symbolValue());
     797        if (obj instanceof CharacterInputStream)
     798            return (CharacterInputStream) obj;
     799        if (obj instanceof TwoWayStream)
     800            return ((TwoWayStream)obj).getInputStream();
     801        throw new ConditionThrowable(new TypeError(obj, "character input stream"));
     802    }
     803
     804    public static final CharacterOutputStream outSynonymOf(LispObject obj)
     805        throws ConditionThrowable
     806    {
     807        if (obj == T)
     808            return checkOutputStream(_TERMINAL_IO_.symbolValue());
     809        if (obj == NIL)
     810            return checkOutputStream(_STANDARD_OUTPUT_.symbolValue());
     811        if (obj instanceof CharacterOutputStream)
     812            return (CharacterOutputStream) obj;
     813        if (obj instanceof TwoWayStream)
     814            return ((TwoWayStream)obj).getOutputStream();
     815        throw new ConditionThrowable(new TypeError(obj, "character output stream"));
     816    }
     817
    790818    public static final Readtable checkReadtable(LispObject obj)
    791819        throws ConditionThrowable
Note: See TracChangeset for help on using the changeset viewer.