Changeset 4043


Ignore:
Timestamp:
09/24/03 22:53:30 (19 years ago)
Author:
piso
Message:

SYS::%SET-CHARPOS

File:
1 edited

Legend:

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

    r3894 r4043  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Extensions.java,v 1.11 2003-09-19 14:44:10 piso Exp $
     5 * $Id: Extensions.java,v 1.12 2003-09-24 22:53:30 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    3636
    3737    // ### charpos
     38    // charpos stream => position
    3839    private static final Primitive1 CHARPOS =
    3940        new Primitive1("charpos", PACKAGE_EXT, true) {
     
    4344                return new Fixnum(((CharacterOutputStream)arg).getCharPos());
    4445            throw new ConditionThrowable(new TypeError(arg, "character output stream"));
     46        }
     47    };
     48
     49    // ### %set-charpos
     50    // %set-charpos stream newval => newval
     51    private static final Primitive2 _SET_CHARPOS =
     52        new Primitive2("%set-charpos", PACKAGE_SYS, false)
     53    {
     54        public LispObject execute(LispObject first, LispObject second)
     55            throws ConditionThrowable
     56        {
     57            if (first instanceof CharacterOutputStream) {
     58                ((CharacterOutputStream)first).setCharPos(Fixnum.getValue(second));
     59                return second;
     60            }
     61            throw new ConditionThrowable(new TypeError(first, "character output stream"));
    4562        }
    4663    };
Note: See TracChangeset for help on using the changeset viewer.