Changeset 4189


Ignore:
Timestamp:
10/04/03 10:48:10 (19 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

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

    r4060 r4189  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Interpreter.java,v 1.39 2003-09-25 18:22:11 piso Exp $
     5 * $Id: Interpreter.java,v 1.40 2003-10-04 10:48:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4646
    4747    private final boolean jlisp;
     48    private final InputStream inputStream;
     49    private final OutputStream outputStream;
    4850
    4951    public static synchronized Interpreter getInstance()
     
    7274    {
    7375        jlisp = false;
     76        inputStream = null;
     77        outputStream = null;
    7478    }
    7579
     
    7781                        String initialDirectory)
    7882    {
     83        jlisp = true;
     84        this.inputStream = inputStream;
     85        this.outputStream = outputStream;
    7986        resetIO(new CharacterInputStream(inputStream),
    8087                new CharacterOutputStream(outputStream));
    81         jlisp = true;
    8288    }
    8389
     
    117123            initialize(jlisp);
    118124            Symbol TOP_LEVEL_LOOP = intern("TOP-LEVEL-LOOP", PACKAGE_TPL);
    119             LispObject replFun = TOP_LEVEL_LOOP.getSymbolFunction();
    120             if (replFun instanceof Function) {
    121                 replFun.execute();
     125            LispObject tplFun = TOP_LEVEL_LOOP.getSymbolFunction();
     126            if (tplFun instanceof Function) {
     127                funcall0(tplFun, thread);
    122128                return;
    123129            }
     
    503509    public void kill()
    504510    {
    505         done = true;
     511        if (jlisp) {
     512            try {
     513                inputStream.close();
     514            }
     515            catch (IOException e) {
     516                Debug.trace(e);
     517            }
     518            try {
     519                outputStream.close();
     520            }
     521            catch (IOException e) {
     522                Debug.trace(e);
     523            }
     524        } else
     525            System.exit(0);
    506526    }
    507527
Note: See TracChangeset for help on using the changeset viewer.