diff --git a/HISTORY.md b/HISTORY.md index 2d24d2f3..4fbd5408 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -9,6 +9,9 @@ * **Documentation Updates:** * updated manual (e.g. p.20) with hyper-semantics of ITEM OF, thanks Brian +### 2021-02-06 +* simplified private list.range() method + ### 2021-02-05 * new manual for v6.6, thanks, Brian! * objects: don't show internal "compile" reporter in search results diff --git a/snap.html b/snap.html index 17144e2c..96965a93 100755 --- a/snap.html +++ b/snap.html @@ -13,7 +13,7 @@ - + diff --git a/src/lists.js b/src/lists.js index 11d353ca..94466d16 100644 --- a/src/lists.js +++ b/src/lists.js @@ -63,7 +63,7 @@ MorphicPreferences, TableDialogMorph, SpriteBubbleMorph, SpeechBubbleMorph, TableFrameMorph, TableMorph, Variable, isSnapObject, Costume, contains, detect, ZERO, WHITE*/ -modules.lists = '2021-February-04'; +modules.lists = '2021-February-07'; var List; var ListWatcherMorph; @@ -409,7 +409,7 @@ List.prototype.query = function (indices) { first = indices.at(1); if (first instanceof List) { select = first.isEmpty() ? - this.range(1, this.length()) + this.range(this.length()) : first; } else { select = new List([first]); @@ -419,9 +419,9 @@ List.prototype.query = function (indices) { ); }; -List.prototype.range = function (start, end) { - // private - answer a list of ascending numbers, incremented by 1 - return new List([...Array(end - start + 1)].map((e, i) => i + start)); +List.prototype.range = function (upTo) { + // private - answer a list of integers from 1 up to the given ceiling + return new List([...Array(upTo)].map((e, i) => i + 1)); }; List.prototype.items = function (indices) {