You can build Elixir with R15B and then use it on R16B. If we memorize the
availability of insert_element on R15B, the code you'll be compiling won't
be benefitting from the optimization.


On Fri, Mar 29, 2013 at 1:33 PM, Devin Torres <notifications@github.com>wrote:

> In lib/elixir/lib/kernel.ex:
>
> > +
> > +  It is implemented as a macro so it can be used in guards.
> > +
> > +  Please note that in versions of Erlang prior to R16B there is no BIF
> > +  for this operation and it is emulated by converting the tuple to a list
> > +  and back and is, therefore, inefficient.
> > +
> > +  ## Example
> > +
> > +      tuple = { :bar, :baz }
> > +      insert_elem(tuple, 0, :foo) #=> { :foo, :bar, :baz }
> > +  """
> > +  case :proplists.get_value(:insert_element,
> > +                            :proplists.get_value(:exports, :erlang.module_info,[])) do
> > +    3 ->
> > +      defmacro insert_elem(tuple, index, value) when is_integer(index) do
>
> Not across differing Erlang versions it isn't.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/elixir-lang/elixir/pull/859/files#r3591129>
> .
>