From 78b3c34942a39834fff8d4dd6a48bc34bd8ae115 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Mon, 9 Oct 2017 15:06:19 -0400 Subject: spec: delete copypasta; add Indexable example Change-Id: Ia389aa8ea27c0e2a8b628bab49a62598178c62e2 --- doc/spec.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'doc') 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 -- cgit v1.2.3