From bf8afa04fc3026ad54721b8bd980bd50a3aa0036 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 6 May 2021 21:46:17 +0300 Subject: [PATCH 1/2] docs... Signed-off-by: Alex A. Naanou --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aef7b37..9f669a5 100644 --- a/README.md +++ b/README.md @@ -1640,8 +1640,8 @@ Equivalents to `Array`'s `.map(..)`, `.filter(..)` and `.reduce(..)` but return generators that yield the handler return values. From 3acf8862fe6abd42dc0e17ab122889425f3a7773 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 7 May 2021 02:50:08 +0300 Subject: [PATCH 2/2] docs... Signed-off-by: Alex A. Naanou --- README.md | 12 ++++-------- generator.js | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9f669a5..4df3165 100644 --- a/README.md +++ b/README.md @@ -1654,15 +1654,11 @@ XXX .reduce(..) can return a non-iterable -- test and document this case... -> ``` - +Note that this does not support negative indexes as it not possible to know the +generator length until it is fully done. - - - -Equivalent to `Array`'s `.slice(..)` but will return a generator instead of an -array, for more info see: +Otherwise this is similar to `Array`'s `.slice(..)` but will return a generator +instead of an array, for more info see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice diff --git a/generator.js b/generator.js index b7d853c..df61912 100644 --- a/generator.js +++ b/generator.js @@ -180,7 +180,7 @@ object.Mixin('GeneratorProtoMixin', 'soft', { // NOTE: this is different from Array's .slice(..) in that it does not // support negative indexes -- this is done because there is no way - // to judge the length of a generator untill it is fully done... + // to judge the length of a generator until it is fully done... slice: function*(from=0, to=Infity){ // sanity check... if(from < 0 || to < 0){