Skip to content

Commit afae575

Browse files
committed
doc: simple vectors specialization on java.nio works only for u8
1 parent a21fd10 commit afae575

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/org/armedbear/lisp/BasicVectorBuffer.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
A SIMPLE-VECTOR specialized on 8, 16, 32, and 64 unsigned byte
1616
types backed by a java.nio.Buffer implmentation.
1717
18+
1819
*/
20+
// Only code paths for (UNSIGNED-BYTE 8) types right now.
1921
public final class BasicVectorBuffer
2022
extends BasicVector
2123
{
@@ -83,7 +85,7 @@ public LispObject AREF(int i) {
8385
case U64:
8486
return LispInteger.getUnsignedInstance(((LongBuffer)data).get(i));
8587
}
86-
return program_error("Bad ELT in BasicVectorBuffer.");
88+
return program_error("Bad array reference in BasicVectorBuffer for " + i);
8789
} catch (ArrayIndexOutOfBoundsException e) {
8890
return badIndex(i, capacity);
8991
}
@@ -152,8 +154,10 @@ public LispObject subseq(int start, int end) {
152154
return result;
153155
} catch (ArrayIndexOutOfBoundsException e) {
154156
String m
155-
= MessageFormat.format("The bounding indices {0} and {1} are bad for a sequence of length {2}.", start, end, length());
156-
return type_error(m, new JavaObject(e), NIL); // Not really a type_error, as there is not one type
157+
= MessageFormat.format("The bounding indices {0} and {1} are bad for a sequence of length {2}.",
158+
start, end, length());
159+
// Not really a type_error, as there is not one type
160+
return type_error(m, new JavaObject(e), NIL);
157161
}
158162
}
159163

src/org/armedbear/lisp/BasicVectorPrimitive.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
public final class BasicVectorPrimitive
2020
extends BasicVector
2121
{
22-
// TODO we can theoretically do this as a single u8 array, with views as shorts, ints, and longs
22+
// TODO do this as a single u8 array, with views as shorts, ints, and longs
2323
byte[] u8;
2424
short[] u16;
2525
int[] u32;
@@ -144,8 +144,10 @@ public LispObject subseq(int start, int end) {
144144
}
145145
} catch (ArrayIndexOutOfBoundsException e) {
146146
String m
147-
= MessageFormat.format("The bounding indices {0} and {1} are bad for a sequence of length {2}.", start, end, length());
148-
return type_error(m, new JavaObject(e), NIL); // Not really a type_error, as there is not one type
147+
= MessageFormat.format("The bounding indices {0} and {1} are bad for a sequence of length {2}.",
148+
start, end, length());
149+
// Not really a type_error, as there is not one type
150+
return type_error(m, new JavaObject(e), NIL);
149151
}
150152
return program_error("Unreachable");
151153
}

0 commit comments

Comments
 (0)