diff options
author | Björn Gustavsson <[email protected]> | 2013-02-12 14:56:05 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-02-13 11:58:44 +0100 |
commit | f8b9d04789cb307c519f7c99493ebc9118a2b8c2 (patch) | |
tree | d542865e2d805020e2bd27896d53cfe2f9fbe30c /lib/stdlib | |
parent | e96b2bc546b13a30707479838f1a5891147a5603 (diff) | |
download | otp-f8b9d04789cb307c519f7c99493ebc9118a2b8c2.tar.gz otp-f8b9d04789cb307c519f7c99493ebc9118a2b8c2.tar.bz2 otp-f8b9d04789cb307c519f7c99493ebc9118a2b8c2.zip |
Don't redefine error/1
It is confusing. Rename our own exception-generating function to
badpattern/1.
Diffstat (limited to 'lib/stdlib')
-rw-r--r-- | lib/stdlib/src/filelib.erl | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/stdlib/src/filelib.erl b/lib/stdlib/src/filelib.erl index 853cf6a6fa..fec9d0ac23 100644 --- a/lib/stdlib/src/filelib.erl +++ b/lib/stdlib/src/filelib.erl @@ -19,9 +19,6 @@ -module(filelib). %% File utilities. - -%% Avoid warning for local function error/1 clashing with autoimported BIF. --compile({no_auto_import,[error/1]}). -export([wildcard/1, wildcard/2, is_dir/1, is_file/1, is_regular/1, compile_wildcard/1]). -export([fold_files/5, last_modified/1, file_size/1, ensure_dir/1]). @@ -37,7 +34,7 @@ catch error:{badpattern,_}=UnUsUalVaRiAbLeNaMe -> %% Get the stack backtrace correct. - erlang:error(UnUsUalVaRiAbLeNaMe) + error(UnUsUalVaRiAbLeNaMe) end). -type filename() :: file:name(). @@ -430,7 +427,7 @@ compile_part_to_sep(Part) -> compile_part(Part, true, []). compile_part([], true, _) -> - error(missing_delimiter); + badpattern(missing_delimiter); compile_part([$,|Rest], true, Result) -> {ok, $,, lists:reverse(Result), Rest}; compile_part([$}|Rest], true, Result) -> @@ -502,8 +499,8 @@ compile_alt(Pattern, Result) -> error end. -error(Reason) -> - erlang:error({badpattern,Reason}). +badpattern(Reason) -> + error({badpattern,Reason}). eval_read_file_info(File, file) -> file:read_file_info(File); |