The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

This is still the case in the published book.

I'm very disappointed - usually Manning publications are high quality.
Edit: Dupe.
Cool. Thank you for replying.

Look forward to the next MEAP.
From the book:

defmodule ListHelper do
  def smallest(list) when length(list) > 0 do
    Enum.min(list)
  end
  def smallest(_), do: {:error, :invalid_argument}
end

You might think that calling ListHelper.smallest/1 with anything other than list will raise an error. This however will not happen. If an error is raised from inside the guard, it will not be propagated, and the guard expression will return false. The corresponding clause will not match, but some other might.
So in the example above, if we call ListHelper.smallest(123), we will get the result :something_else, which demonstrates that an error in the guard expression is internally handled.


However my output from iex...

Interactive Elixir (1.0.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> ListHelper.smallest(123)
{:error, :invalid_argument}
iex(2)>


Did I just misunderstand the passage or was some other error supposed to be returned...?

Thanks.