Skip to content

Commit 56a4e4d

Browse files
authored
docs: rename to slice
1 parent 04721c2 commit 56a4e4d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

SPEC.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ Type = TypeName [ TypeArgs ] | TypeLit | "(" Type ")" .
248248
TypeName = identifier | QualifiedIdent .
249249
TypeArgs = "[" TypeList [ "," ] "]" .
250250
TypeList = Type { "," Type } .
251-
TypeLit = VectorType | TableType | FunctionType .
251+
TypeLit = SliceType | TableType | FunctionType .
252252
```
253253

254-
The language predeclares certain type names. Others are introduced with type declarations or type parameter lists. Composite types—vector, table, function types—may be constructed using type literals.
254+
The language predeclares certain type names. Others are introduced with type declarations or type parameter lists. Composite types—slice, table, function types—may be constructed using type literals.
255255

256256
Predeclared types, defined types, and type parameters are called named types. An alias denotes a named type if the type given in the alias declaration is a named type.
257257

@@ -330,17 +330,17 @@ func(a, _ uint32, z uint64) bool
330330

331331
TODO
332332

333-
## Vector types
333+
## Slice types
334334

335-
An vector is a numbered sequence of elements of a single type, called the element type. The number of elements is called the length of the vector and is never negative.
335+
An slice is a numbered sequence of elements of a single type, called the element type. The number of elements is called the length of the slice and is never negative.
336336

337337
```
338-
VectorType = "[" VectorLength "]" ElementType .
339-
VectorLength = Expression .
338+
SliceType = "[" SliceLength "]" ElementType .
339+
SliceLength = Expression .
340340
ElementType = Type .
341341
```
342342

343-
The length is part of the vector's type; it must evaluate to a non-negative constant representable by a value of type int. The length of vector a can be discovered using the built-in function size. The elements can be addressed by integer indices 0 through len(a)-1. Vector types are always one-dimensional but may be composed to form multi-dimensional types.
343+
The length is part of the slice's type; it must evaluate to a non-negative constant representable by a value of type int. The length of slice a can be discovered using the built-in function size. The elements can be addressed by integer indices 0 through len(a)-1. Slice types are always one-dimensional but may be composed to form multi-dimensional types.
344344

345345
## Struct
346346

0 commit comments

Comments
 (0)