in reply to Re^2: Using lazy list with a for loop
in thread Using lazy list with a for loop
E.g. you can use syntactic sugar to define 2 subs from(&;@) loop(&) with prototypes to define your own loop construct like
from { LIST | ITER } $a,$b => loop { BODY }
an from would check if ITER was blessed to an iterator class and act accordingly.
But you can guess that this would be slow. I suppose even if implemented in XS it would be slow.
BUT "it is ONE user interface".
Are you willing to pay that price?
Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Using lazy list with a for loop
by Anonymous Monk on Jan 03, 2023 at 00:26 UTC | |
by LanX (Saint) on Jan 03, 2023 at 00:33 UTC | |
by ikegami (Patriarch) on Jan 03, 2023 at 04:18 UTC | |
by LanX (Saint) on Jan 03, 2023 at 15:24 UTC | |
by ikegami (Patriarch) on Jan 03, 2023 at 16:26 UTC | |
by Anonymous Monk on Jan 03, 2023 at 04:16 UTC | |
by LanX (Saint) on Jan 03, 2023 at 15:32 UTC |