On Saturday, December 3, 2016 at 10:12:30 AM UTC-6, José Valim wrote:
> Basically, what compelling problem drove this change? It isn't an issue I
> ever had before, and the change seems to make my code worse.
>
> There were a couple scenarios that I either personally ran into or were
> frequently reported. One of those came from Plug test suite. In Plug it is
> common to pass the connection named as "conn" around between setup/tests:
>
So we lose things like this?
iex(2)> v
warning: variable "v" does not exist and is being expanded to "v()", please use
parentheses to remove the ambiguity or change the variable name
iex:2
There’s a simple cure for variable/function ambiguity—choose good names and
write trivial functions. This kind of thing typically bites when your code
is struggling in some extended swamp of names. Maybe being bitten on those
occasions is just what the developer needs to stop doing it :)
Even if you really, really want to do this (please reconsider), could we at
least not warn if the ambiguity can be resolved at compile time—if there’s
a function/0 available with the given name, just compile it as a call and
move on?
Dave
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/271c22e4-2a36-496d-8fcf-744efdbd565a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.