Changeset 5931


Ignore:
Timestamp:
02/24/04 15:05:02 (17 years ago)
Author:
piso
Message:

Moved SVREF and %SVSET to SimpleVector?.java.

File:
1 edited

Legend:

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

    r5922 r5931  
    33 *
    44 * Copyright (C) 2002-2004 Peter Graves
    5  * $Id: Primitives.java,v 1.580 2004-02-24 12:29:40 piso Exp $
     5 * $Id: Primitives.java,v 1.581 2004-02-24 15:05:02 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    19031903    };
    19041904
    1905     // ### svref
    1906     // svref simple-vector index => element
    1907     private static final Primitive2 SVREF = new Primitive2("svref","simple-vector index") {
    1908         public LispObject execute(LispObject first, LispObject second)
    1909             throws ConditionThrowable
    1910         {
    1911             AbstractVector v = checkVector(first);
    1912             if (!v.isSimpleVector())
    1913                 signal(new TypeError(first, "simple vector"));
    1914             int index = v.checkIndex(second);
    1915             return v.get(index);
    1916         }
    1917     };
    1918 
    1919     // ### %svset
    1920     // %svset simple-vector index new-value => new-value
    1921     private static final Primitive3 _SVSET =
    1922         new Primitive3("%svset", PACKAGE_SYS, false) {
    1923         public LispObject execute(LispObject first, LispObject second,
    1924                                   LispObject third)
    1925             throws ConditionThrowable
    1926         {
    1927             AbstractVector v = checkVector(first);
    1928             if (!v.isSimpleVector())
    1929                 signal(new TypeError(first, "simple vector"));
    1930             int i = v.checkIndex(second);
    1931             v.set(i, third);
    1932             return third;
    1933         }
    1934     };
    1935 
    19361905    // ### fill-pointer
    19371906    private static final Primitive1 FILL_POINTER =
Note: See TracChangeset for help on using the changeset viewer.