website
website copied to clipboard
Invalid Elixir block syntax in "Gleam for Elixir Users"
I was reading the Blocks section of the Gleam for Elixir Users and I was surprised by this syntax — when I tried it in iex
, it's not valid Elixir
x = do
print(1)
2
end
Maybe there is a syntax, but I couldn't find it 🤔
(I saw 1.14
in the screenshot, but I tried 1.15
and 1.16
too: same problem)
This seems to be correct?
iex(1)> x = (
...(1)> IO.puts(1)
...(1)> 2
...(1)> )
1
2
iex(2)> x
2
iex(3)>
https://hexdocs.pm/elixir/1.16.1/syntax-reference.html#blocks ... same for ages https://hexdocs.pm/elixir/1.8.0/syntax-reference.html#blocks
Yep, that works 👍
Should I open a PR, or you've got it?