Changeset 4998


Ignore:
Timestamp:
12/07/03 16:44:06 (18 years ago)
Author:
piso
Message:

SIMPLE-STRING-FILL

File:
1 edited

Legend:

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

    r4995 r4998  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: LispString.java,v 1.67 2003-12-07 01:15:27 piso Exp $
     5 * $Id: LispString.java,v 1.68 2003-12-07 16:44:06 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    158158    public void fill(char c)
    159159    {
    160         for (int i = array.length; i-- > 0;)
     160        final int limit = fillPointer >= 0 ? fillPointer : array.length;
     161        for (int i = limit; i-- > 0;)
    161162            array[i] = c;
    162163    }
     
    446447        }
    447448    };
     449
     450    // ### simple-string-fill string character => string
     451    private static final Primitive2 STRING_FILL =
     452        new Primitive2("simple-string-fill", PACKAGE_EXT, true)
     453    {
     454        public LispObject execute(LispObject first, LispObject second)
     455            throws ConditionThrowable
     456        {
     457            checkString(first).fill(LispCharacter.getValue(second));
     458            return first;
     459        }
     460    };
    448461}
Note: See TracChangeset for help on using the changeset viewer.