diff options
author | Alan Donovan <adonovan@google.com> | 2017-10-09 15:06:19 -0400 |
---|---|---|
committer | Alan Donovan <adonovan@google.com> | 2017-10-09 15:06:19 -0400 |
commit | 78b3c34942a39834fff8d4dd6a48bc34bd8ae115 (patch) | |
tree | 7bbfc53cb4df0c66ae1c06398c7de67ba7991bb5 /doc | |
parent | 773cec9c137a324c7b0c56662f579316be2a1f82 (diff) | |
download | starlark-go-78b3c34942a39834fff8d4dd6a48bc34bd8ae115.tar.gz |
spec: delete copypasta; add Indexable example
Change-Id: Ia389aa8ea27c0e2a8b628bab49a62598178c62e2
Diffstat (limited to 'doc')
-rw-r--r-- | doc/spec.md | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/doc/spec.md b/doc/spec.md index 306c2d7..08b97b0 100644 --- a/doc/spec.md +++ b/doc/spec.md @@ -1360,7 +1360,7 @@ the interpreter's Go API. Examples: `dict`, `set`, `list`, `tuple`, but not `string`. * `Indexable`: an _indexed_ type has a fixed length and provides efficient random access to its elements, which are identified by integer indices. - Examples: `string`, `tuple`. + Examples: `string`, `tuple`, and `list`. * `SetIndexable`: a _settable indexed type_ additionally allows us to modify the element at a given integer index. Example: `list`. * `Mapping`: a mapping is an association of keys to values. Example: `dict`. @@ -1369,8 +1369,6 @@ Although all of Skylark's core data types for sequences implement at least the `Sequence` contract, it's possible for an an application that embeds the Skylark interpreter to define additional data types representing sequences of unknown length that implement only the `Iterable` contract. -representing sequences whose length is unknown, or perhaps even infinite, that implement -only the `Iterable` contract. Strings are not iterable, though they do support the `len(s)` and `s[i]` operations. Skylark deviates from Python here to avoid common |