# New Ticket Created by  Sam S. 
# Please include the string:  [perl #130572]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=130572 >


    ➜  say (for ^4 { .say }).WHAT;
    0
    1
    2
    3
    (List)

    ➜  say (lazy for ^4 { .say }).WHAT;
    0
    1
    2
    3
    (Seq)

I would have expected an output of just `(Seq)` in both cases, or at
least in the second case.

The synopses don't seem to make a statement on whether a `List` or
`Seq` should be returned, but S04 is quite clear that both should be
lazy <https://design.perl6.org/S04.html#line_688>:

    lazy loops can be indicated by putting the loop in parens
    or brackets:

       (... if COND for LIST)      # lazy list comprehension
       [for LIST { ... }]
        (loop { ... })

    or by use of either a statement prefix or a phaser in
    statement form:

       lazy for LIST { ... }
       ENTER for LIST { ... }

According to bisectable and committable
<https://gist.github.com/dd0b5601f4198d88bbfd8dc746d7eb25>, Rakudo has
always done it like it does now, though.

---
This is Rakudo version 2016.12-315-gdaf7e5185 built on MoarVM version
2016.12-113-gd1da1bac
implementing Perl 6.c.

Reply via email to