You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SPEC.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -248,10 +248,10 @@ Type = TypeName [ TypeArgs ] | TypeLit | "(" Type ")" .
248
248
TypeName = identifier | QualifiedIdent .
249
249
TypeArgs = "[" TypeList [ "," ] "]" .
250
250
TypeList = Type { "," Type } .
251
-
TypeLit = VectorType | TableType | FunctionType .
251
+
TypeLit = SliceType | TableType | FunctionType .
252
252
```
253
253
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.
255
255
256
256
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.
257
257
@@ -330,17 +330,17 @@ func(a, _ uint32, z uint64) bool
330
330
331
331
TODO
332
332
333
-
## Vector types
333
+
## Slice types
334
334
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.
336
336
337
337
```
338
-
VectorType = "[" VectorLength "]" ElementType .
339
-
VectorLength = Expression .
338
+
SliceType = "[" SliceLength "]" ElementType .
339
+
SliceLength = Expression .
340
340
ElementType = Type .
341
341
```
342
342
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.
0 commit comments