"into: Stream" plays well with the current semantics where "into: ..." changes the return value however, because emitting a stream would require "for" to emit a completely different code than today, "into: Stream" would only work if the Stream module is given at compilation time. In a nutshell, this is welcome, but it is a relatively high amount of work.
On Thu, Jul 22, 2021 at 12:56 PM luk...@niemier.pl <luk...@niemier.pl> wrote: > Currently, while there is `:into` option in `for`, there is no way to make > it into "regular" stream. It would be handy to have a way to either make > something like: > > ``` > for a <- 1..10, b <- 1..10, into: Stream, do: {a, b} > ``` > > Or have additional option: > > ``` > for a <- 1..10, b <- 1..10, stream: true, do: {a, b} > ``` > > That would make `for` to return stream. This can be handy in cases where > resulted list would be so huge, that it would start to be problematic for > VM to catch up. > > -- > You received this message because you are subscribed to the Google Groups > "elixir-lang-core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to elixir-lang-core+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/671c053f-359e-4b35-b696-4e262de30583n%40googlegroups.com > <https://groups.google.com/d/msgid/elixir-lang-core/671c053f-359e-4b35-b696-4e262de30583n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4Kgjzi3b8eDDiy4RifFPNGCoWD%2BcKQZLZmF9NE2nOVSaQ%40mail.gmail.com.