elixir-lang / elixir-lang.github.com

Website for Elixir
elixir-lang.org
354 stars 822 forks source link

Update the example for variables visibility in the do-block of `try` #1532

Closed nicnilov closed 3 years ago

nicnilov commented 3 years ago

The iex> what_happened line is unnecessary. The ** (RuntimeError) undefined function: what_happened/0 will be caused by an attempt to access the variable within the rescue block. This line will attempt to do the same again, which will only demonstrate that the variables defined inside the try block do not leak, as was already shown by the preceding example.

josevalim commented 3 years ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:

josevalim commented 3 years ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart: