[erlang-patches] [PATCH 2/3] hipe: Do not auto-import min/2 and max/2
Mon Sep 13 17:47:14 CEST 2010
Tuncer Ayaz writes:
> On Sun, Sep 12, 2010 at 11:20 PM, Mikael Pettersson wrote:
> > I initially thought that these min/max functions were local
> > function similar to the erlang ones (they didn't use to be
> > standard so we used to have to duplicate them), but the issue
> > in hipe_icode_type is that it explicitly imports min/max from
> > erl_types, and that explicit import triggers a warning due to
> > the newish auto-import from erlang.
> > Given that I think your initial no_auto_import patch is Ok.
> Isn't changing min() to erl_types:min() a cleaner change?
No. The author of that code clearly wanted to use -import to
get direct access to all relevant functions from erl_types.
Un-importing a few of them because of Erlang stupidities makes
the code inconsistent and therefore ugly.
Just use the workaround.
More information about the erlang-patches