gleam-lang / website

🏑 Gleam's website and guide

Home Page:https://gleam.run

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid Elixir block syntax in "Gleam for Elixir Users"

jpalardy opened this issue Β· comments

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

(code link)

Screenshot 2024-02-07 at 10 27 19

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)>

Yep, that works πŸ‘

Should I open a PR, or you've got it?