Introduce "array[N] T" and "slice T" type syntax

This commit is contained in:
Nigel Tao committed 2018-04-05 22:21:08 +10:00
1 parent 2b91e7861c
commit d33db6dae0
15 files changed
+83 -68

No files matched your search

+2 -2
View File
@@ -73,7 +73,7 @@ pri struct adler32?(
)
// TODO: add a ! as this function is impure.
pri func adler32.update(x[] u8)(checksum u32) {
pri func adler32.update(x slice u8)(checksum u32) {
// The Adler-32 checksum's magic 65521 and 5552 numbers are discussed in
// RFC 1950.
@@ -81,7 +81,7 @@ pri func adler32.update(x[] u8)(checksum u32) {
var s2 u32 = this.state.high_bits(n:16)
while in.x.length() > 0 {
var remaining[] u8
var remaining slice u8
if in.x.length() > 5552 {
remaining = in.x[5552:]
in.x = in.x[:5552]