Changeset 4042
- Timestamp:
- 09/24/03 22:50:56 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/Primitives.java
r4032 r4042 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Primitives.java,v 1.43 4 2003-09-23 16:32:04piso Exp $5 * $Id: Primitives.java,v 1.435 2003-09-24 22:50:56 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 3820 3820 }; 3821 3821 3822 // ### read 3822 3823 // read &optional input-stream eof-error-p eof-value recursive-p => object 3823 3824 private static final Primitive READ = new Primitive("read") { … … 3833 3834 boolean recursive = length > 3 ? (args[3] != NIL) : false; 3834 3835 return stream.read(eofError, eofValue, recursive); 3836 } 3837 }; 3838 3839 // ### read-char 3840 // read-char &optional input-stream eof-error-p eof-value recursive-p => char 3841 private static final Primitive READ_CHAR = new Primitive("read-char") { 3842 public LispObject execute(LispObject[] args) throws ConditionThrowable 3843 { 3844 int length = args.length; 3845 if (length > 4) 3846 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3847 CharacterInputStream stream = 3848 length > 0 ? checkInputStream(args[0]) : getStandardInput(); 3849 boolean eofError = length > 1 ? (args[1] != NIL) : true; 3850 LispObject eofValue = length > 2 ? args[2] : NIL; 3851 boolean recursive = length > 3 ? (args[3] != NIL) : false; 3852 return stream.readChar(eofError, eofValue); 3853 } 3854 }; 3855 3856 // ### unread-char 3857 // unread-char character &optional input-stream => nil 3858 private static final Primitive UNREAD_CHAR = new Primitive("unread-char") { 3859 public LispObject execute(LispObject[] args) throws ConditionThrowable 3860 { 3861 int length = args.length; 3862 if (length < 1) 3863 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 3864 CharacterInputStream stream = 3865 length > 1 ? checkInputStream(args[1]) : getStandardInput(); 3866 return stream.unreadChar(checkCharacter(args[0])); 3835 3867 } 3836 3868 };
Note: See TracChangeset
for help on using the changeset viewer.