You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rewrite, remove inaccurate Range truncation info (#1681)
* Rewrite, remove inaccurate Range trucation info
Previously, this section stated that:
* All ranges (including non-lazy ones) will truncate the output/ omit
undefined elements.
Rewrote the section to remove that inaccuracy and address the following:
* If the element at index [x] does not exist then the result will be an
undefined element (when subscripting Positionals).
* This behavior can be modified using the :v adverb.
* Using lazy Iterables as subscripts yields a different behavior. Only
returns defined elements (most of the time; see bullets below).
* Behind the scenes the elements of the lazy subscript are being
reified up until the point that the element in the Positional
is undefined.
* Continued use of lazy Lists will begin to return undefined
elements as new elements in the lazy List are reified.
* Include justification for these behaviors. Sometimes returning
undefined elements is desirable.
* DESIRABLE: assignment. eg @A[^10] = 1..10;
* NOT DESIRABLE: Out-of-memory due to uncontrolled indexing.
This removes some information about lack of protection against runaway
slices and reification of subscript elements in instances where the
undefined values are not being returned from the collection (eg,
instances where the same index is being used over and over again). This
seemed a little out of place in this section and probably fits better
elsewhere. Perhaps it would be appropriate in the Traps section?
SEE ALSO:
[Issue #1679](#1679)
https://irclog.perlgeek.de/perl6/2017-11-18#i_15466865
* Incorporate feedback on "Truncating Slices"
Incorporate feedback by zoffix. Includes:
* Replace "defined" with "exists".
* Remove unnecessarily detailed explanation of reification and Rakudo's
slicing implementation.
* Move indexing "drift" explanation to Traps.
See <#1681>.
* Revise Lazy Lists section and add index
Added and index for the "Lazy List" section in list.pod6. Revised it a
to address these points:
* Fix error with .elems (outdated behavior?).
* Show small example of laziness and it's semantics.
* Outline the common use case of infinite lists
Also linked to this section from "Truncating Slices".
0 commit comments