Re:The Comprehensive Guide to Elixir's List Comprehension (2...
by nickpeterson on Wednesday June 28, 2023 @07:28PM
(#36514162)
I generally just use for loops but I’m in the pocket of Big Ignorance.
[ Parent
| on HN ]
Re:The Comprehensive Guide to Elixir's List Comprehension (2...
by PKop on Wednesday June 28, 2023 @11:31PM
(#36515993)
Elixir doesn't have for loops
Re:The Comprehensive Guide to Elixir's List Comprehension (2...
by arrowsmith on Thursday June 29, 2023 @03:02AM
(#36517308)
for x <- 1..10 do
IO.puts x
end
Isn't that a for loop?
Re:The Comprehensive Guide to Elixir's List Comprehension (2...
by Munksgaard on Thursday June 29, 2023 @06:42AM
(#36518717)
In Elixir that is a called a comprehension, just like the blog post is discussing.
Re:The Comprehensive Guide to Elixir's List Comprehension (2...
by PKop on Thursday June 29, 2023 @09:52AM
(#36520393)
Similar, but different in subtle ways when you get beyond the toy example posted here...particularly that it's always iterating a collection, vs being able to just arbitrarily loop based on arbitrary conditions..where you'd be able to easily break out of it, modify a mutable collection within it etc
https://dev.to/brewinstallbuzzwords/does-elixir-have-for-loo... "Does Elixir have for loops?"
https://elixirforum.com/t/changing-variables-in-a-loop/43526 "Changing variables in a loop"
https://stackoverflow.com/questions/56196664/better-way-writ...
https://stackoverflow.com/questions/48178773/adding-items-to...