Changeset 4045
- Timestamp:
- 09/25/03 00:40:16 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/Primitives.java
r4042 r4045 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Primitives.java,v 1.43 5 2003-09-24 22:50:56 piso Exp $5 * $Id: Primitives.java,v 1.436 2003-09-25 00:40:16 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 3895 3895 }; 3896 3896 3897 // ### vector-subseq 3898 // vector-subseq vector start &optional end => subsequence 3897 3899 private static final Primitive3 VECTOR_SUBSEQ = 3898 new Primitive3("vector-subseq", PACKAGE_SYS, false) { 3899 public LispObject execute(LispObject vector, LispObject start, 3900 LispObject end) throws ConditionThrowable 3901 { 3902 AbstractVector v = checkVector(vector); 3903 return v.subseq(Fixnum.getValue(start), 3904 end == NIL ? v.length() : Fixnum.getValue(end)); 3900 new Primitive3("vector-subseq", PACKAGE_SYS, false) 3901 { 3902 public LispObject execute(LispObject first, LispObject second, 3903 LispObject third) 3904 throws ConditionThrowable 3905 { 3906 AbstractVector v = checkVector(first); 3907 int start = Fixnum.getValue(second); 3908 int end = third != NIL ? Fixnum.getValue(third) : v.length(); 3909 if (start > end) 3910 throw new ConditionThrowable(new TypeError("start is greater than end")); 3911 return v.subseq(start, end); 3905 3912 } 3906 3913 };
Note: See TracChangeset
for help on using the changeset viewer.