diff --git a/README.md b/README.md index e8211d8..b851c1d 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. @@ -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){