Changeset 10124


Ignore:
Timestamp:
10/16/05 11:54:44 (16 years ago)
Author:
piso
Message:

READ-LINE

File:
1 edited

Legend:

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

    r10117 r10124  
    33 *
    44 * Copyright (C) 2002-2005 Peter Graves
    5  * $Id: Primitives.java,v 1.829 2005-10-15 20:08:49 piso Exp $
     5 * $Id: Primitives.java,v 1.830 2005-10-16 11:54:44 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    39913991    };
    39923992
    3993     // ### read-line
    3994     // read-line &optional input-stream eof-error-p eof-value recursive-p
     3993    // ### read-line &optional input-stream eof-error-p eof-value recursive-p
    39953994    // => line, missing-newline-p
    39963995    private static final Primitive READ_LINE =
     
    39983997                      "&optional input-stream eof-error-p eof-value recursive-p")
    39993998    {
     3999        public LispObject execute() throws ConditionThrowable
     4000        {
     4001            final LispObject obj = _STANDARD_INPUT_.symbolValue();
     4002            final Stream stream;
     4003            try {
     4004                stream = (Stream) obj;
     4005            }
     4006            catch (ClassCastException e) {
     4007                return signalTypeError(obj, Symbol.STREAM);
     4008            }
     4009            return stream.readLine(true, NIL);
     4010        }
    40004011        public LispObject execute(LispObject arg) throws ConditionThrowable
    40014012        {
     
    40134024            return inSynonymOf(first).readLine(second != NIL, third);
    40144025        }
    4015         public LispObject execute(LispObject[] args) throws ConditionThrowable
    4016         {
    4017             int length = args.length;
    4018             if (length > 4)
    4019                 signal(new WrongNumberOfArgumentsException(this));
    4020             Stream stream =
    4021                 length > 0 ? inSynonymOf(args[0]) : getStandardInput();
    4022             boolean eofError = length > 1 ? (args[1] != NIL) : true;
    4023             LispObject eofValue = length > 2 ? args[2] : NIL;
    4024             boolean recursive = length > 3 ? (args[3] != NIL) : false;
    4025             return stream.readLine(eofError, eofValue);
     4026        public LispObject execute(LispObject first, LispObject second,
     4027                                  LispObject third, LispObject fourth)
     4028            throws ConditionThrowable
     4029        {
     4030            // recursive-p is ignored
     4031            return inSynonymOf(first).readLine(second != NIL, third);
    40264032        }
    40274033    };
Note: See TracChangeset for help on using the changeset viewer.