Skip to content

Commit bcf9d81

Browse files
author
José Valim
committed
Remove deprecated code
1 parent 69a4138 commit bcf9d81

File tree

13 files changed

+8
-126
lines changed

13 files changed

+8
-126
lines changed

lib/elixir/lib/code.ex

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@ defmodule Code do
5757
:code.del_path(Path.expand to_char_list(path))
5858
end
5959

60-
@doc false
61-
def eval(string, binding // [], opts // []) do
62-
IO.write "[WARNING] Code.eval is deprecated, please use Code.eval_string instead\n#{Exception.format_stacktrace}"
63-
eval_string(string, binding, opts)
64-
end
65-
6660
@doc """
6761
Evaluates the contents given by string. The second argument is the
6862
binding (which should be a keyword) followed by a keyword list of

lib/elixir/lib/enum.ex

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,6 @@ defmodule Enum do
388388
end
389389
end
390390

391-
@doc false
392-
def at!(collection, n) when n >= 0 do
393-
IO.write "[WARNING] Enum.at! is deprecated, please use Enum.fetch! instead\n#{Exception.format_stacktrace}"
394-
fetch!(collection, n)
395-
end
396-
397391
@doc """
398392
Filters the collection, i.e. returns only those elements
399393
for which `fun` returns true.

lib/elixir/lib/exception.ex

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,6 @@ defmodule Exception do
150150
ErlangError[original: other]
151151
end
152152

153-
@doc false
154-
def format_entry(entry, cwd // nil) do
155-
IO.write "[WARNING] Exception.format_stacktrace is deprecated, please use Exception.format_stacktrace_entry instead\n#{Exception.format_stacktrace}"
156-
format_stacktrace_entry(entry, cwd)
157-
end
158-
159153
@doc """
160154
Receives a tuple representing a stacktrace entry and formats it.
161155
The current working directory may be given as argument, which

lib/elixir/lib/hash_dict.ex

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,6 @@ defmodule HashDict do
151151
end
152152
end
153153

154-
@doc false
155-
def get!(dict, key) when is_tuple(dict) do
156-
IO.write "[WARNING] Dict.get! and HashDict.get! are deprecated, please use Dict.fetch! and HashDict.fetch! instead\n#{Exception.format_stacktrace}"
157-
case dict_get(dict, key) do
158-
{ ^key, value } -> value
159-
false -> raise(KeyError, key: key)
160-
end
161-
end
162-
163154
@doc """
164155
Fetches the value under key from the dict
165156
and return it in a tagged tuple.

lib/elixir/lib/io.ex

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -180,25 +180,6 @@ defmodule IO do
180180
:io.get_chars(map_dev(device), to_iodata(prompt), count)
181181
end
182182

183-
@doc false
184-
def getb(prompt, count // 1)
185-
186-
def getb(prompt, count) when is_integer(count) do
187-
IO.write "[WARNING] IO.getb is deprecated, please use IO.getn instead\n#{Exception.format_stacktrace}"
188-
getn(prompt, count)
189-
end
190-
191-
def getb(device, prompt) do
192-
IO.write "[WARNING] IO.getb is deprecated, please use IO.getn instead\n#{Exception.format_stacktrace}"
193-
getn(device, prompt)
194-
end
195-
196-
@doc false
197-
def getb(device, prompt, count) do
198-
IO.write "[WARNING] IO.getb is deprecated, please use IO.getn instead\n#{Exception.format_stacktrace}"
199-
getn(device, prompt, count)
200-
end
201-
202183
@doc """
203184
Reads a line from the IO device. It returns:
204185

lib/elixir/lib/kernel.ex

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,12 +1998,6 @@ defmodule Kernel do
19981998
quote do: :erlang.setelement(unquote(index) + 1, unquote(tuple), unquote(value))
19991999
end
20002000
2001-
@doc false
2002-
defmacro setelem(tuple, index, value) do
2003-
IO.puts "setelem is deprecated, please use set_elem instead\n#{Exception.format_stacktrace(__CALLER__.stacktrace)}"
2004-
quote do: :erlang.setelement(unquote(index) + 1, unquote(tuple), unquote(value))
2005-
end
2006-
20072001
@doc """
20082002
Define insert_elem to insert element into a tuple according to
20092003
Elixir conventions (i.e. it expects the tuple as first argument,

lib/elixir/lib/keyword.ex

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,6 @@ defmodule Keyword do
114114
end
115115
end
116116

117-
@doc false
118-
def get!(keywords, key) when is_atom(key) do
119-
IO.write "[WARNING] Keyword.get! is deprecated, please use Keyword.fetch! instead\n#{Exception.format_stacktrace}"
120-
case :lists.keyfind(key, 1, keywords) do
121-
{ ^key, value } -> value
122-
false -> raise(KeyError, key: key)
123-
end
124-
end
125-
126117
@doc """
127118
Fetchs the value for specific key and return it in a tuple.
128119
If the key does not exist, returns `:error`.

lib/elixir/lib/list.ex

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,6 @@ defmodule List do
142142
:lists.last(list)
143143
end
144144

145-
@doc false
146-
def member?(list, term) do
147-
IO.write "[WARNING] List.member? is deprecated, please use Enum.member? instead\n#{Exception.format_stacktrace}"
148-
:lists.member(term, list)
149-
end
150-
151145
@doc """
152146
Receives a list of tuples and returns the first tuple
153147
where the item at position `position` matches with the

lib/elixir/lib/list_dict.ex

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,6 @@ defmodule ListDict do
6565
end
6666
end
6767

68-
@doc false
69-
def get!(dict, key) do
70-
IO.write "[WARNING] Dict.get! and ListDict.get! are deprecated, please use Dict.fetch! and ListDict.fetch! instead\n#{Exception.format_stacktrace}"
71-
case :lists.keyfind(key, 1, dict) do
72-
{ ^key, value } -> value
73-
false -> raise(KeyError, key: key)
74-
end
75-
end
76-
7768
@doc """
7869
Returns the value under key from the given
7970
dict in a tagged tuple, otherwise `:error`.

lib/elixir/src/elixir_quote.erl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ erl_escape(Expr, Unquote, S) ->
6363
quote(Expr, Q, S) ->
6464
do_quote(Expr, Q, S).
6565

66-
erl_quote({ 'unquote_splicing', Meta, [_] } = Expr, #elixir_quote{unquote=true} = Q, S) ->
67-
elixir_errors:deprecation(Meta, S#elixir_scope.file, "unquote_splicing in the quote body is deprecated, please use (unquote_splicing()) instead", []),
68-
erl_quote({ '__block__', Meta, [Expr] }, Q, S);
69-
7066
erl_quote(Expr, Q, S) ->
7167
{ QExpr, TQ } = quote(Expr, Q, S),
7268
{ TExpr, TS } = elixir_translator:translate_each(QExpr, S),

0 commit comments

Comments
 (0)