Elixir v1.7.0 released

Announcement: https://elixir-lang.org/blog/2018/07/25/elixir-v1-7-0-released/
Release notes: https://github.com/elixir-lang/elixir/releases/tag/v1.7.0

Thanks to everyone who gave the RC a try and reported back!

Happy coding!

61 Likes

Whoo hoo! Well done José and all the Core Team members and everyone who was involved with the release… and of course congrats once again to @michalmuskala :023:

Here’s a link to the documentary again for those who haven’t seen it yet (why not!?)

I like the new development section of the website too - it outlines the goals of the language and the criteria for how/what is added really well :smiley:

12 Likes

Congrats!!!

1 Like

I’m wondering how this one was resolved / answered? I’d expect this question will pop up for more library authors over time.

4 Likes

:love_you_gesture: congrats . Still hacking with elixir and having fun! keep going guys :slight_smile:

The guidance is to comment out @doc since: ... until the library no longer supports Elixir versions lower than 1.7. Alternatively you could choose to do conditional compilation, but arguably it makes the code look weird for little gain. See this issue for more details.

If you start to rely heavily on documentation metadata and still want to support older versions of Elixir I recommend creating a small helper module with macros to simplify the addition of metadata. Something like this could do the job:

defmodule Meta do
  if System.version() < "1.7" do
    defmacro moduledoc(keyword) when is_list(keyword), do: :ok
    defmacro typedoc(keyword) when is_list(keyword), do: :ok
    defmacro doc(keyword) when is_list(keyword), do: :ok
  else
    defmacro moduledoc(keyword), do: put_meta(__CALLER__, :moduledoc, keyword)
    defmacro typedoc(keyword), do: put_meta(__CALLER__, :typedoc, keyword)
    defmacro doc(keyword), do: put_meta(__CALLER__, :doc, keyword)

    defp put_meta(%{module: module, line: line}, attribute, keyword) do
      Module.put_attribute(module, attribute, {line, keyword})
    end
  end
end

defmodule Mod do
  @moduledoc "This is is my Mod module"
  require Meta
  Meta.moduledoc(author: "László")

  @typedoc "And this is my type"
  Meta.typedoc(since: "1.6.0")
  @type t :: any

  @doc "And this is my function in it"
  Meta.doc(since: "1.6.0")
  def f, do: :ok
end

The impact on the code (and eyes) will be lower with this and replacing it is almost just a search and replace still.

2 Likes

Elixir v1.7.1 is out for those running into a bug when adding the Elixir application to Dialyzer.

8 Likes

Congrats all!

[Kernel] not left in right is ambiguous and is deprecated in favor of left not in right

Im not sure what this is saying exactly?

1 Like
iex(4)> 1 in [1,2,3]
true
iex(5)> 1 not in [1,2,3]
false
iex(6)> not 1 in [1,2,3]
warning: "not expr1 in expr2" is deprecated. Instead use "expr1 not in
expr2" if you require Elixir v1.5+, or "not(expr1 in expr2)" if you
have to support earlier Elixir versions
  iex:6

false
iex(7)>
8 Likes

Congrats.

Congrats! Superb work!!

Elixir v1.7.2 has been released an important fix for umbrella apps: https://github.com/elixir-lang/elixir/releases/tag/v1.7.2

4 Likes